@@ -76,6 +76,11 @@ public static string Usage
76
76
/// </summary>
77
77
public bool IsFullScreen { get ; private set ; }
78
78
79
+ /// <summary>
80
+ /// Gets a value indicating whether to prompt the user before closing the timer window if the timer is running.
81
+ /// </summary>
82
+ public bool PromptOnExit { get ; private set ; }
83
+
79
84
/// <summary>
80
85
/// Gets a value indicating whether an icon for the app should be visible in the notification area of the
81
86
/// taskbar.
@@ -183,6 +188,7 @@ public TimerOptions GetTimerOptions()
183
188
{
184
189
Title = this . Title ,
185
190
AlwaysOnTop = this . AlwaysOnTop ,
191
+ PromptOnExit = this . PromptOnExit ,
186
192
LoopTimer = this . LoopTimer ,
187
193
PopUpWhenExpired = this . PopUpWhenExpired ,
188
194
CloseWhenExpired = this . CloseWhenExpired ,
@@ -224,6 +230,7 @@ private static CommandLineArguments GetArgumentsFromMostRecentOptions()
224
230
Title = null ,
225
231
AlwaysOnTop = options . AlwaysOnTop ,
226
232
IsFullScreen = windowSize . IsFullScreen ,
233
+ PromptOnExit = options . PromptOnExit ,
227
234
ShowInNotificationArea = Settings . Default . ShowInNotificationArea ,
228
235
LoopTimer = options . LoopTimer ,
229
236
PopUpWhenExpired = options . PopUpWhenExpired ,
@@ -254,6 +261,7 @@ private static CommandLineArguments GetArgumentsFromFactoryDefaults()
254
261
Title = defaultOptions . Title ,
255
262
AlwaysOnTop = defaultOptions . AlwaysOnTop ,
256
263
IsFullScreen = defaultOptions . WindowSize . IsFullScreen ,
264
+ PromptOnExit = defaultOptions . PromptOnExit ,
257
265
ShowInNotificationArea = false ,
258
266
LoopTimer = defaultOptions . LoopTimer ,
259
267
PopUpWhenExpired = defaultOptions . PopUpWhenExpired ,
@@ -334,6 +342,19 @@ private static CommandLineArguments GetCommandLineArguments(IEnumerable<string>
334
342
argumentsBasedOnFactoryDefaults . IsFullScreen = isFullScreen ;
335
343
break ;
336
344
345
+ case "--prompt-on-exit" :
346
+ case "-o" :
347
+ ThrowIfDuplicateSwitch ( specifiedSwitches , "--prompt-on-exit" ) ;
348
+
349
+ bool promptOnExit = GetBoolValue (
350
+ arg ,
351
+ remainingArgs ,
352
+ argumentsBasedOnMostRecentOptions . PromptOnExit ) ;
353
+
354
+ argumentsBasedOnMostRecentOptions . PromptOnExit = promptOnExit ;
355
+ argumentsBasedOnFactoryDefaults . PromptOnExit = promptOnExit ;
356
+ break ;
357
+
337
358
case "--show-in-notification-area" :
338
359
case "-n" :
339
360
ThrowIfDuplicateSwitch ( specifiedSwitches , "--show-in-notification-area" ) ;
0 commit comments