From b186128a59b0556efd5fed6ccf7a017d30b4445e Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Mon, 15 Aug 2011 10:11:05 +0000 Subject: [PATCH] Added RemoveCommand() to the CommandManager git-svn-id: https://radegast.googlecode.com/svn/trunk@1093 f7a694da-4d33-11de-9ad6-1127a62b9fcd --- Radegast/Core/Commands/CommandsManager.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Radegast/Core/Commands/CommandsManager.cs b/Radegast/Core/Commands/CommandsManager.cs index bb84930..85e9edc 100644 --- a/Radegast/Core/Commands/CommandsManager.cs +++ b/Radegast/Core/Commands/CommandsManager.cs @@ -134,6 +134,20 @@ namespace Radegast.Commands return cmd; } + public void RemoveCommand(string name) + { + lock (CommandsLoaded) + { + if (CommandsByName.ContainsKey(name)) + { + var cmd = CommandsByName[name]; + CommandsLoaded.Remove(cmd); + CommandsByName.Remove(name); + cmd.Dispose(); + } + } + } + public void Help(string args, ConsoleWriteLine WriteLine) { int found = 0; -- 2.11.0