public void Run(string commandString) { Command temCmd = new Command(); temCmd.AnalyzeCommandString(commandString); int i; bool commandFired = false ; for (i = 0; i < this.Commands.Count; i++) { if (this.Commands[i].Command.CommandName == temCmd.CommandName) { commandFired = true; this.Commands[i].Command.Parameters = temCmd.Parameters; try { if (!this.Commands[i].Run()) base.RaiseUpdateMessage(this, "Run command " + Commands[i].Command.CommandName + " failed.", SMTP.Commands.CommandEvent.CommandMessageType.Error); } catch (Exception ex) { base.RaiseUpdateMessage(this, "Exception: " + ex.Message, SMTP.Commands.CommandEvent.CommandMessageType.Error); } } } if (commandFired == false) base.RaiseUpdateMessage(this, "No this command!", SMTP.Commands.CommandEvent.CommandMessageType.Warning); }
private void Initialize() { this.Command = new Command(); }