public void ExecuteCommand(string cmd) { if (!(cmd.Length > 0)) { return; } bool handled; CommandModel cd = new CommandModel(Frontend.FrontendManager, _Notebook.CurrentChatView.ChatModel, (string)Frontend.UserConfig["Interface/Entry/CommandCharacter"], cmd); handled = _Command(cd); if (!handled) { handled = Frontend.Session.Command(cd); } if (!handled) { // we may have no network manager yet Engine.IProtocolManager nm = Frontend.FrontendManager.CurrentProtocolManager; if (nm != null) { handled = nm.Command(cd); } else { handled = false; } } if (!handled) { _CommandUnknown(cd); } }
public void ExecuteCommand(string cmd) { if (cmd == null) { throw new ArgumentNullException("cmd"); } ChatModel chat = null; if (f_MainWindow.ChatViewManager.ActiveChat != null) { chat = f_MainWindow.ChatViewManager.ActiveChat.ChatModel; } bool handled = false; CommandModel cd = new CommandModel(Frontend.FrontendManager, chat, (string)Frontend.UserConfig["Interface/Entry/CommandCharacter"], cmd); handled = Command(cd); if (!handled) { handled = Frontend.Session.Command(cd); } if (!handled) { // we may have no network manager yet Engine.IProtocolManager nm = Frontend.FrontendManager.CurrentProtocolManager; if (nm != null) { handled = nm.Command(cd); } else { handled = false; } } if (!handled) { _CommandUnknown(cd); } }