コード例 #1
0
        /// <summary>
        /// Invoked when there is a request to run a command. This
        /// could as a result of the user activating a button on the
        /// scanner and there is a command associated with the button
        /// </summary>
        /// <param name="command">command to run</param>
        /// <param name="commandArg">any optional arguments</param>
        /// <param name="handled">was this handled?</param>
        public override void OnRunCommand(String command, object commandArg, ref bool handled)
        {
            handled = true;

            switch (command)
            {
            case "TextFile":

                if (checkValidOrCreate(Common.AppPreferences.NewTextFileCreateFolder))
                {
                    Context.AppPanelManager.CloseCurrentForm();
                    showNewFileDialogForTextFile();
                }

                break;

            case "WordDoc":
                if (checkValidOrCreate(Common.AppPreferences.NewWordDocCreateFolder))
                {
                    Context.AppPanelManager.CloseCurrentForm();
                    showNewFileDialogForWordDoc();
                }

                break;

            case "clearText":
                if (_newFileNameForm != null && confirm("Clear File Name?"))
                {
                    _newFileNameForm.ClearFileName();
                }

                break;

            case "exitFileTypeMenu":
                ExitCode = CompletionCode.None;
                Context.AppPanelManager.CloseCurrentForm();
                handleQuit(false);
                break;

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