You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Essentials/AutoCommand.cs
+35-20Lines changed: 35 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -57,18 +57,6 @@ public string Name
57
57
set=>SetValue(ref_name,value);
58
58
}
59
59
60
-
//[Display(Name = "Scheduled Time", GroupName = "Schedule", Description = "Sets a time of day for this command to be run. Format is HH:MM:SS. MUST use 24 hour format! Will be reset to zero if Interval is set.")]
61
-
[Display(Visible=false)]
62
-
publicstringScheduledTime
63
-
{
64
-
get=>_scheduledTime.ToString();
65
-
set
66
-
{
67
-
_scheduledTime=TimeSpan.Parse(value);
68
-
OnPropertyChanged();
69
-
}
70
-
}
71
-
72
60
[Display(Order=2,Description="Sets an interval/Time for this command to be repeated. Format is HH:MM:SS.")]
73
61
publicstringInterval
74
62
{
@@ -79,7 +67,6 @@ public string Interval
79
67
OnPropertyChanged();
80
68
if(CommandTrigger==Trigger.Timed)
81
69
{
82
-
//ScheduledTime = TimeSpan.Zero.ToString(); //I hate myself for this **FIXED!!!***
83
70
_nextRun=DateTime.Now+_interval;
84
71
}
85
72
@@ -157,6 +144,7 @@ public void Update()
157
144
158
145
if(_currentStep<Steps.Count)return;
159
146
_currentStep=0;
147
+
_cTokenSource?.Dispose();
160
148
_nextRun=_trigger==Trigger.Scheduled
161
149
?DateTime.Now.Date+_interval+TimeSpan.FromDays(1)
162
150
:_nextRun=DateTime.Now+_interval;
@@ -204,26 +192,54 @@ public override string ToString()
204
192
}
205
193
}
206
194
195
+
privateCancellationTokenSource_cTokenSource;
207
196
208
197
/// <summary>
209
198
/// Runs the command and all steps immediately, in a new thread
0 commit comments