/// <summary> /// This method implements the command action. /// The command text is the Command property value. /// </summary> public override void Invoke(object sender, ModuleCommandEventArgs e) { try { string command = e.Command.Trim().ToUpper(); if (ProcessMacros(command)) return; if (ProcessSpecialCommands(command)) return; ProcessShortcutCommand(command); } catch (Exception) { //TODO Senthil } }
/// <summary> /// Command handler called from the command line with a prefix. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The arguments.</param> public abstract void Invoke(object sender, ModuleCommandEventArgs e);
void OnCommandInvoke2(object sender, ModuleCommandEventArgs e) { string currentDirectory = A.Psf.SyncPaths(); try { A.Psf.Act(e.Command, null, !e.IsMacro); } finally { A.SetCurrentDirectoryFinally(currentDirectory); } }
void OnCommandInvoke1(object sender, ModuleCommandEventArgs e) { string currentDirectory = A.Psf.SyncPaths(); try { A.Psf.Act(e.Command, new ConsoleOutputWriter(CommandInvoke1.Prefix + ":" + e.Command), !e.IsMacro); } finally { A.SetCurrentDirectoryFinally(currentDirectory); } }