コード例 #1
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);
        }
コード例 #2
0
ファイル: ModuleManager.cs プロジェクト: pezipink/FarNet
        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;
        }