예제 #1
0
        private void Remove(ICommandManager commandManager, IPlugin plugin, String name, ushort arity)
        {
            QualifiedNameTypes qualifiedName = QualifiedAliasName(plugin.Name, name, arity);

            if(!_aliases.ContainsKey(qualifiedName) || !_commands.ContainsKey(qualifiedName))
                throw new InvalidOperationException("Alias with name " + name + " and arity " + arity
                    + " does not exist.");

            AliasData alias = _aliases[qualifiedName];
            AliasCommand command = _commands[qualifiedName];
            commandManager.Remove(command);

            _unqualifiedAliases.Remove(name, arity);
            _commands.Remove(qualifiedName);
            _aliases.Remove(qualifiedName);
            Aliases.Remove(alias);
        }