public SaveMacroCommand(String name, CommandScope scope, bool active, MacroDefinition md) : base(name, scope, active) { this.md = md; this.next = null; }
public CmdEntry(CmdEntryFunction f, Object clientData) { function = f; command = null; dictionary = null; this.clientData = clientData; }
public CmdEntry(Dictionary<String, CmdEntry> dict, Object clientData) { function = null; command = null; dictionary = dict; this.clientData = clientData; }
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; }
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; }
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(); }
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); }
public void setNext(Command next) { this.next = next; }
public void autoActivate(Command c) { activateCmds.Add(c); if (deactivateCmds.Contains(c)) deactivateCmds.Remove(c); c.addActivator(this); }
public void removeAutoCmd(Command c) { activateCmds.Remove(c); deactivateCmds.Remove(c); c.removeActivator(this); }
public void removeActivator(Command c) { autoActivators.Remove(c); }
public void autoDeactivate(Command c) { deactivateCmds.Add(c); if (activateCmds.Contains(c)) activateCmds.Remove(c); c.removeActivator(this); }
public virtual void setLastCommand(Command command) { lastCommand = command; }
public virtual void setUndoCommand(Command command) { undoCommand = command; }
public void addActivator(Command c) { autoActivators.Add(c); }