示例#1
0
 public override bool doIt(CommandInterface ci)
 {
     switch (commandType)
     {
         case CmdType.Log:
             if (messageWindow.LogFile != null)
                 messageWindow.log(null);
             else
                 messageWindow.postLogDialog();
             break;
         case CmdType.Save:
             messageWindow.postSaveDialog();
             break;
         case CmdType.Close:
             messageWindow.Close();
             break;
         case CmdType.NextError:
             messageWindow.findNextError();
             break;
         case CmdType.PrevError:
             messageWindow.findPrevError();
             break;
         case CmdType.Tracing:
             messageWindow.toggleTracing();
             break;
         case CmdType.Memory:
             messageWindow.memoryUse();
             break;
         default:
             System.Diagnostics.Debug.Assert(false);
             break;
     }
     return true;
 }
        public DXToolStripMenuItem(String name, Command cmd)
            : base()
        {
            ci = new CommandInterface(name, cmd, this);

            this.Click += new EventHandler(cmd.executeEvent);
        }
        public override bool doIt(CommandInterface ci)
        {
            Debug.Assert(network != null);

            switch (commandType)
            {
                case NetworkCommandType.HelpOnNetwork:
                    network.postHelpOnNetworkDialog();
                    break;
                case NetworkCommandType.SetNetworkName:
                    network.postNameDialog();
                    break;
                case NetworkCommandType.SaveNetwork:
                    network.saveNetwork(network.FileName);
                    break;
                case NetworkCommandType.SaveNetworkAs:
                    if (network.IsNetworkSavable)
                        network.postSaveAsDialog(network.IsMacro ?
                            network.getEditor() : DXApplication.theDXApplication.getAnchor());
                    break;
                case NetworkCommandType.SaveConfiguration:
                    network.postSaveCfgDialog(network.IsMacro ?
                        network.getEditor() : DXApplication.theDXApplication.getAnchor());
                    break;
                case NetworkCommandType.OpenConfiguration:
                    network.postOpenCfgDialog(network.IsMacro ?
                        network.getEditor() : DXApplication.theDXApplication.getAnchor());
                    break;
                default:
                    Debug.Assert(false);
                    break;
            }
            return true;
        }
 public override bool doIt(CommandInterface ci)
 {
     // This will automatically get called by WinForms--no need
     // to actually do it here. Make sure that all Components have
     // a componentHelp function then register a delegate for
     // HelpRequested.
     return true;
 }
        public override bool execute(CommandInterface ci)
        {
            Form pf = parent;
            if (parent == null)
                pf = MainProgram.theApplication.getAnchorForm();

            QuestionDialog qd = new QuestionDialog();
            qd.modalPost(pf, dialogQuestion, dialogTitle,
                this, ok_Click, null, null, null, null,
                null, 2);

            return false;
        }
        public override bool execute(CommandInterface ci)
        {
            if (needsConfirmation())
            {
                base.execute(ci);
            }
            else
            {
                base.baseExecute(ci);
            }

            return false;
        }
        public DXToolStripMenuItem(String name, Command cmd,
            String bubbleHelp)
            : base()
        {
            ci = new CommandInterface(name, cmd, this);

            this.Click += new EventHandler(cmd.executeEvent);

            if (bubbleHelp != null)
            {
                // set bubble help
            }
        }
        /// <summary>
        /// Overrides the supperclass execute() function:
        /// First posts a dialog to ask for user confirmation before
        /// actually executing the command.
        /// </summary>
        /// <param name="ci"></param>
        /// <returns></returns>
        public override bool execute(CommandInterface ci)
        {
            this.ci = ci;

            Form fp = parent;
            if (fp == null)
                fp = MainProgram.theApplication.getAnchorForm();

            QuestionDialog qd = new QuestionDialog();
            qd.modalPost(parent, dialogQuestion, dialogTitle, this,
                yes_Click, no_Click, cancel_Click, "Yes", "No", "Cancel", 3);

            return false;
        }
        public override bool doIt(CommandInterface ci)
        {
            String message = "Do you want to save macro " + md.getNetwork().NameString;
            message += " as file: " + md.FileName;

            QuestionDialog qd = new QuestionDialog();
            qd.modalPost(
                DXApplication.theDXApplication.getAnchor(),
                message, "Save Confirmation",
                this,
                SaveMacro,
                DiscardMacro,
                null, "Yes", "No", null, 2);

            return true;
        }
        public override bool doIt(CommandInterface ci)
        {
            String dialogQuestion = "";
            if (!application.appAllowsConfirmedQuit())
            {
                application.shutdownApplication();
                return true;
            }

            if (this.command == null)
            {
                dialogQuestion = "Do you really want to quit " + application.getInformalName();

                CommandScope scope = scopeList[0];
                command = new QuitCommand(application, "quit", scope, true,
                    "Quit", dialogQuestion);
            }
            this.command.execute(ci);
            return true;
        }
        public override bool doIt(CommandInterface ci)
        {
            Debug.Assert(network != null);

            switch (commandType)
            {
                case JavaNetCommandType.SaveBean:
                    network.saveBean();
                    break;
                case JavaNetCommandType.SaveApplet:
                    network.saveApplet();
                    break;
                case JavaNetCommandType.SaveWebPage:
                    network.saveWebPage();
                    break;
                default:
                    Debug.Assert(false);
                    break;
            }
            return true;
        }
示例#12
0
        public override bool doIt(CommandInterface ci)
        {
            bool ret = false;

                switch (commandType)
                {
                    case HelpType.GenericHelp:
                        Debug.Assert(ci != null);
                        ci.componentHelp();
                        ret = true;
                        break;
                    case HelpType.HelpTutorial:
                        ret = MainProgram.theApplication.startTutorial();
                        break;
                    case HelpType.AboutApp:
                        InfoDialog id = new InfoDialog();
                        id.post(MainProgram.theApplication.getAboutAppString());
                        ret = true;
                        break;
                    case HelpType.TechSupport:
                        String url = "file://" + MainProgram.theApplication.getUIRoot() +
                            "/html/pages/qikgu033.htm";

                        Process p = Process.Start("iexplore.exe", url);
                        if (p == null)
                        {
                            InfoDialog infoDialog = new InfoDialog();
                            infoDialog.post(MainProgram.theApplication.getTechSupportString());
                        }
                        ret = true;
                        break;
                    default:
                        Debug.Assert(false);
                        break;
                }
                return ret;
        }
        public override bool doIt(CommandInterface ci)
        {
            bool ret=false;
            SequencerNode seq_node = null;

            Debug.Assert(application != null);

            switch (commandType)
            {
                case DXApplication.CommandType.StartServer:
                    ret = application.postStartServerDialog();
                    break;
                case DXApplication.CommandType.ResetServer:
                    ret = application.resetServer();
                    break;
                case DXApplication.CommandType.ExecuteOnce:
                    application.getExecCtl().executeOnce();
                    break;
                case DXApplication.CommandType.ExecuteOnChange:
                    application.getExecCtl().enableExecOnChange();
                    break;
                case DXApplication.CommandType.EndExecution:
                    application.getExecCtl().terminateExecution();
                    break;
                case DXApplication.CommandType.OpenNetwork:
                    application.postOpenNetworkDialog();
                    break;
                case DXApplication.CommandType.LoadMacro:
                    application.postLoadMacroDialog();
                    break;
                case DXApplication.CommandType.AssignProcessGroup:
                    application.postProcessGroupAssignDialog();
                    break;
                case DXApplication.CommandType.OpenAllColormaps:
                    if (application.network == null)
                        ret = false;
                    else
                        application.network.openColormap(true);
                    break;
                case DXApplication.CommandType.OpenSequencer:
                    Debug.Assert(application.network != null);
                    seq_node = application.network.sequencer;
                    if (seq_node == null)
                        ret = false;
                    else
                    {
                        seq_node.openDefaultWindow(application.getAnchorForm());
                        ret = true;
                    }
                    break;
                case DXApplication.CommandType.OpenMessageWindow:
                    application.MessageWindow.Show();
                    ret = true;
                    break;
                case DXApplication.CommandType.ToggleInfoEnabled:
                    application.enableInfo(application.IsInfoEnabled);
                    break;
                case DXApplication.CommandType.ToggleWarningEnabled:
                    application.enableWarning(application.IsWarningEnabled);
                    break;
                case DXApplication.CommandType.ToggleErrorEnabled:
                    application.enableError(application.IsErrorEnabled);
                    break;
                case DXApplication.CommandType.LoadUserMDF:
                    application.postLoadMDFDialog();
                    ret = true;
                    break;
                case DXApplication.CommandType.HelpOnManual:
                    application.helpOn("OnManual");
                    ret = true;
                    break;
                case DXApplication.CommandType.HelpOnHelp:
                    application.helpOn("OnHelp");
                    ret = true;
                    break;
                default:
                    Debug.Assert(false);
                    break;
            }
            return ret;
        }
示例#14
0
 public abstract bool doIt(CommandInterface ci);
 public override bool doIt(CommandInterface ci)
 {
     return DXApplication.theDXApplication.disconnectFromServer();
 }
示例#16
0
        public virtual bool execute(CommandInterface ci)
        {
            bool result;

            if (!active)
                return false;

            if (MainProgram.theApplication == null)
            {
                StackFrame stackFrame = new StackFrame();
                MethodBase methodBase = stackFrame.GetMethod();
                throw new Exception(string.Format("{0}: invalid arg", methodBase));
            }

            MainProgram.theApplication.setBusyCursor(true);
            if (doIt(ci))
            {
                foreach (CommandScope scope in scopeList)
                {
                    if (scope.getUndoCommand() != null)
                    {
                        if (hasUndo)
                        {
                            scope.setLastCommand(this);
                            scope.getUndoCommand().activate();
                        }
                        else
                        {
                            scope.setLastCommand(null);
                            scope.getUndoCommand().deactivate(null);
                        }
                    }
                }
                foreach (Command c in activateCmds)
                {
                    c.activate();
                }
                foreach (Command c in deactivateCmds)
                {
                    c.deactivate(null);
                }
                result = true;
            }
            else
                result = false;

            MainProgram.theApplication.setBusyCursor(false);

            return result;
        }
示例#17
0
 public override bool doIt(CommandInterface ci)
 {
     this.application.postOpenNetworkDialog();
     return true;
 }
示例#18
0
 public override bool doIt(CommandInterface ci)
 {
     messageWindow.clear();
     return true;
 }
示例#19
0
 public override bool doIt(CommandInterface ci)
 {
     application.shutdownApplication();
     return true;
 }
示例#20
0
 public override bool doIt(CommandInterface ci)
 {
     DXApplication.theDXApplication.resetServer();
     return network.clear();
 }
 public override bool doIt(CommandInterface ci)
 {
     window.closeWindow();
     return true;
 }
 public bool baseExecute(CommandInterface ci)
 {
     return base.execute(ci);
 }