public SaveMacroCommand(String name, CommandScope scope,
     bool active, MacroDefinition md)
     : base(name, scope, active)
 {
     this.md = md;
     this.next = null;
 }
Esempio n. 2
0
 public CmdEntry(CmdEntryFunction f, Object clientData)
 {
     function = f;
     command = null;
     dictionary = null;
     this.clientData = clientData;
 }
Esempio n. 3
0
 public CmdEntry(Dictionary<String, CmdEntry> dict, Object clientData)
 {
     function = null;
     command = null;
     dictionary = dict;
     this.clientData = clientData;
 }
Esempio n. 4
0
 public CmdEntry(Command command)
 {
     function = null;
     this.command = command;
     dictionary = null;
     clientData = null;
 }
 public ConfirmedQuitCommand(String name, CommandScope scope,
     bool active, DXApplication app)
     : base(name, scope, active,
     "Save Confirmation", "Do you want to save the program?")
 {
     application = app;
     command = null;
 }
Esempio n. 6
0
        public void addCommand(String command, Command func)
        {
            CmdEntry cmd;
            Dictionary<String, CmdEntry> dict = this.commandEntry.getDictionary();

            if (func == null)
            {
                Dictionary<String, CmdEntry> d = new Dictionary<String, CmdEntry>();
                cmd = new CmdEntry(d, this);
            }
            else
            {
                cmd = new CmdEntry(func);
            }

            dict.Add(command, cmd);
        }
        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;
        }
Esempio n. 8
0
        public JavaNet()
        {
            // In C#, constructors work a little different than C++ with
            // respect to virtual functions. C# will call a override function
            // if it exists in a subclass even though the contructor of the
            // subclass may still not have been completed. C++ calls the base
            // classes virtual function instead. We ran into this problem
            // here due to the fact that changeExistanceWork is called in
            // the Network() constructor, but the following 3 commands have
            // not been initialized yet. So we had to change the function a bit
            // and add the deactivates here in the constructor.

            saveWebPageCmd = new NoUndoJavaNetCommand("saveWebPageCommand", commandScope,
                false, this, NoUndoJavaNetCommand.JavaNetCommandType.SaveWebPage);

            saveAppletCmd = new NoUndoJavaNetCommand("saveAppletCommand", commandScope,
                false, this, NoUndoJavaNetCommand.JavaNetCommandType.SaveApplet);

            saveBeanCmd = new NoUndoJavaNetCommand("saveBeanCommand", commandScope,
                true, this, NoUndoJavaNetCommand.JavaNetCommandType.SaveBean);

            saveWebPageCmd.deactivate();
            saveAppletCmd.deactivate();
        }
Esempio n. 9
0
        public void addSubCommand(String command, String subcommand, Command func)
        {
            Dictionary<String, CmdEntry> dict = this.commandEntry.getDictionary();
            Dictionary<String, CmdEntry> subdict;
            CmdEntry oe = dict[command];
            CmdEntry ne;

            if (oe == null)
            {
                Console.WriteLine("adding subcommand ({0}) to nonexistent command ({1})",
            subcommand, command);
            }

            subdict = oe.getDictionary();
            if (subdict == null)
            {
                Console.WriteLine("adding subcommand ({0}) to bad command ({1})",
            subcommand, command);
            }

            ne = new CmdEntry(func);
            subdict.Add(subcommand, ne);
        }
Esempio n. 10
0
 public void setNext(Command next)
 {
     this.next = next;
 }
Esempio n. 11
0
 public void autoActivate(Command c)
 {
     activateCmds.Add(c);
     if (deactivateCmds.Contains(c))
         deactivateCmds.Remove(c);
     c.addActivator(this);
 }
Esempio n. 12
0
        public void removeAutoCmd(Command c)
        {
            activateCmds.Remove(c);
            deactivateCmds.Remove(c);

            c.removeActivator(this);
        }
Esempio n. 13
0
 public void removeActivator(Command c)
 {
     autoActivators.Remove(c);
 }
Esempio n. 14
0
 public void autoDeactivate(Command c)
 {
     deactivateCmds.Add(c);
     if (activateCmds.Contains(c))
         activateCmds.Remove(c);
     c.removeActivator(this);
 }
Esempio n. 15
0
 public virtual void setLastCommand(Command command)
 {
     lastCommand = command;
 }
Esempio n. 16
0
 public virtual void setUndoCommand(Command command)
 {
     undoCommand = command;
 }
Esempio n. 17
0
 public void addActivator(Command c)
 {
     autoActivators.Add(c);
 }