예제 #1
0
        public ProxyCommand(ModuleManager manager, Guid id, ModuleCommandAttribute attribute, EventHandler<ModuleCommandEventArgs> handler)
            : base(manager, id, (attribute == null ? null : (ModuleCommandAttribute)attribute.Clone()))
        {
            _Handler = handler;

            Init();
        }
예제 #2
0
        public ProxyCommand(ModuleManager manager, Guid id, ModuleCommandAttribute attribute, EventHandler <ModuleCommandEventArgs> handler)
            : base(manager, id, (attribute == null ? null : (ModuleCommandAttribute)attribute.Clone()))
        {
            _Handler = handler;

            Init();
        }
예제 #3
0
        public override IModuleCommand RegisterModuleCommand(Guid id, ModuleCommandAttribute attribute, EventHandler <ModuleCommandEventArgs> handler)
        {
            if (handler == null)
            {
                throw new ArgumentNullException("handler");
            }
            if (attribute == null)
            {
                throw new ArgumentNullException("attribute");
            }
            if (string.IsNullOrEmpty(attribute.Name))
            {
                throw new ArgumentException("'attribute.Name' must not be empty.");
            }

            ProxyCommand it = new ProxyCommand(this, id, attribute, handler);

            it.LoadData((Hashtable)ReadSettings()[it.Id]);

            Host.Instance.RegisterProxyCommand(it);
            return(it);
        }
예제 #4
0
        public override IModuleCommand RegisterModuleCommand(Guid id, ModuleCommandAttribute attribute, EventHandler<ModuleCommandEventArgs> handler)
        {
            if (handler == null)
                throw new ArgumentNullException("handler");
            if (attribute == null)
                throw new ArgumentNullException("attribute");
            if (string.IsNullOrEmpty(attribute.Name))
                throw new ArgumentException("'attribute.Name' must not be empty.");

            ProxyCommand it = new ProxyCommand(this, id, attribute, handler);
            it.LoadData((Hashtable)ReadSettings()[it.Id]);

            Host.Instance.RegisterProxyCommand(it);
            return it;
        }