ACAT.Lib.Extension.CommandHandlers.ShowScreenLockHandler.Execute C# (CSharp) Method

Execute() public method

Executes the command
public Execute ( bool &handled ) : bool
handled bool set to true if the command was handled
return bool
        public override bool Execute(ref bool handled)
        {
            handled = true;

            Form form = Dispatcher.Scanner.Form;
            form.Invoke(new MethodInvoker(delegate()
            {
                if (DialogUtils.ConfirmScanner(form as IPanel, ACATExtension.Resources.LockTheScreen))
                {
                    Form screenLockForm = Context.AppPanelManager.CreatePanel("ScreenLockForm");
                    if (screenLockForm != null)
                    {
                        WindowActivityMonitor.Pause();
                        Context.AppPanelManager.ShowDialog(form as IPanel, screenLockForm as IPanel);
                    }
                }
            }));

            return true;
        }
    }