ACAT.Lib.Extension.AppAgents.Notepad.NotepadAgentBase.OnRunCommand C# (CSharp) Method

OnRunCommand() public method

Invoked to run a command
public OnRunCommand ( String command, object commandArg, bool &handled ) : void
command String The command to execute
commandArg object Optional arguments for the command
handled bool set this to true if handled
return void
        public override void OnRunCommand(String command, object commandArg, ref bool handled)
        {
            handled = true;
            switch (command)
            {
                case "SaveFile":
                    AgentManager.Instance.Keyboard.Send(Keys.LControlKey, Keys.S);
                    //DialogUtils.Toast("Saved");
                    break;

                case "CmdFind":
                    AgentManager.Instance.Keyboard.Send(Keys.LControlKey, Keys.F);
                    break;

                case "NotepadLectureManager":
                    if (TextControlAgent != null)
                    {
                        String text = TextControlAgent.GetText();
                        if (String.IsNullOrEmpty(text.Trim()))
                        {
                            DialogUtils.ShowTimedDialog(PanelManager.Instance.GetCurrentPanel() as Form,
                                                ACATExtension.Resources.LectureManager, ACATExtension.Resources.DocumentIsEmpty);
                            break;
                        }

                        if (DialogUtils.ConfirmScanner(ACATExtension.Resources.LoadThisDocumentIntoLectureManager))
                        {
#pragma warning disable 4014
                            launchLectureManager();
#pragma warning restore 4014
                        }
                    }

                    break;

                case "SwitchAppWindow":
                    DialogUtils.ShowTaskSwitcher(_notepadProcessName);
                    break;

                default:
                    base.OnRunCommand(command, commandArg, ref handled);
                    break;
            }
        }