Ejemplo n.º 1
0
        public static void UnregisterCommand(GenericCommand command)
        {
            lock (commands)
            {
                if (!commands.ContainsKey(command.Name))
                {
                    throw new WmibException("There is no such a command in pool: " + command.Name);
                }

                commands.Remove(command.Name);
                Syslog.DebugLog("Unregistered command: " + command.Name);
            }
        }
Ejemplo n.º 2
0
 public static void RegisterCommand(GenericCommand command)
 {
     lock (commands)
     {
         if (commands.ContainsKey(command.Name))
         {
             throw new WmibException("This command is already registered: " + command.Name);
         }
         if (command.Module != null)
         {
             Syslog.DebugLog("Module " + command.Module + " registered a new command: " + command.Name);
         }
         else
         {
             Syslog.DebugLog("Registering a new command: " + command.Name);
         }
         commands.Add(command.Name, command);
     }
 }
Ejemplo n.º 3
0
        public static void UnregisterCommand(GenericCommand command)
        {
            lock (commands)
            {
                if (!commands.ContainsKey(command.Name))
                    throw new WmibException("There is no such a command in pool: " + command.Name);

                commands.Remove(command.Name);
                Syslog.DebugLog("Unregistered command: " + command.Name);
            }
        }
Ejemplo n.º 4
0
 public static void RegisterCommand(GenericCommand command)
 {
     lock (commands)
     {
         if (commands.ContainsKey(command.Name))
         {
             throw new WmibException("This command is already registered: " + command.Name);
         }
         if (command.Module != null)
         {
             Syslog.DebugLog("Module " + command.Module + " registered a new command: " + command.Name);
         }
         else
         {
             Syslog.DebugLog("Registering a new command: " + command.Name);
         }
         commands.Add(command.Name, command);
     }
 }
Ejemplo n.º 5
0
 protected void RegisterCommand(GenericCommand command)
 {
     command.Module = this.Name;
     CommandPool.RegisterCommand(command);
 }