コード例 #1
0
ファイル: ServiceRegister.cs プロジェクト: X0R0X/mvc
        public void UnregisterService(AService Service)
        {
            var t = Service.GetType();

            if (this._register.ContainsKey(t))
            {
                this._register.Remove(t);
            }
            else
            {
                throw new Exception("Service for type " + t + " not registered.");
            }
        }
コード例 #2
0
ファイル: ServiceRegister.cs プロジェクト: X0R0X/mvc
        public void RegisterService(AService Service)
        {
            var t = Service.GetType();

            if (this._register.ContainsKey(t))
            {
                throw new Exception("Service for type " + t + " already registered.");
            }
            else
            {
                this._register[t] = Service;
            }
        }