@@ -159,6 +159,12 @@ public static string Usage
159159 /// </summary>
160160 public Rect WindowBounds { get ; private set ; }
161161
162+ /// <summary>
163+ /// Gets a value indicating whether the user interface should be locked, preventing the user from taking any
164+ /// action until the timer expires.
165+ /// </summary>
166+ public bool LockInterface { get ; private set ; }
167+
162168 #endregion
163169
164170 #region Public Methods
@@ -224,7 +230,8 @@ public TimerOptions GetTimerOptions()
224230 Sound = this . Sound ,
225231 LoopSound = this . LoopSound ,
226232 WindowTitleMode = this . WindowTitleMode ,
227- WindowSize = this . GetWindowSize ( )
233+ WindowSize = this . GetWindowSize ( ) ,
234+ LockInterface = this . LockInterface
228235 } ;
229236 }
230237
@@ -274,7 +281,8 @@ private static CommandLineArguments GetArgumentsFromMostRecentOptions()
274281 WindowTitleMode = options . WindowTitleMode ,
275282 WindowState = windowSize . WindowState != WindowState . Minimized ? windowSize . WindowState : windowSize . RestoreWindowState ,
276283 RestoreWindowState = windowSize . RestoreWindowState ,
277- WindowBounds = windowSize . RestoreBounds
284+ WindowBounds = windowSize . RestoreBounds ,
285+ LockInterface = options . LockInterface
278286 } ;
279287 }
280288
@@ -310,7 +318,8 @@ private static CommandLineArguments GetArgumentsFromFactoryDefaults()
310318 WindowTitleMode = WindowTitleMode . ApplicationName ,
311319 WindowState = defaultOptions . WindowSize . WindowState ,
312320 RestoreWindowState = defaultOptions . WindowSize . RestoreWindowState ,
313- WindowBounds = defaultWindowBoundsWithLocation
321+ WindowBounds = defaultWindowBoundsWithLocation ,
322+ LockInterface = defaultOptions . LockInterface
314323 } ;
315324 }
316325
@@ -575,6 +584,18 @@ private static CommandLineArguments GetCommandLineArguments(IEnumerable<string>
575584 argumentsBasedOnFactoryDefaults . WindowBounds = argumentsBasedOnFactoryDefaults . WindowBounds . Merge ( windowBounds ) ;
576585 break ;
577586
587+ case "--lock-interface" :
588+ case "-z" :
589+ ThrowIfDuplicateSwitch ( specifiedSwitches , "--lock-interface" ) ;
590+
591+ bool lockInterface = GetBoolValue (
592+ arg ,
593+ remainingArgs ) ;
594+
595+ argumentsBasedOnMostRecentOptions . LockInterface = lockInterface ;
596+ argumentsBasedOnFactoryDefaults . LockInterface = lockInterface ;
597+ break ;
598+
578599 case "--use-factory-defaults" :
579600 case "-d" :
580601 ThrowIfDuplicateSwitch ( specifiedSwitches , "--use-factory-defaults" ) ;
0 commit comments