コード例 #1
0
ファイル: MachineExConfig.cs プロジェクト: WangWeight/Protein
        /// <summary>
        /// 初始化扩展配置
        /// </summary>
        protected virtual void InisExConfig()
        {
            excc = new ECC();
            ProteinConfig pconfig = ProteinConfig.GetInstance();

            foreach (ExConfig config in pconfig.ExConfigs)
            {
                string xmlfilepath = this.GetType().Assembly.GetAssemblyPath()
                                     + config.ConfigXMLPath + "/" + config.ConfigXML;
                string dllfilepath = this.GetType().Assembly.GetAssemblyPath()
                                     + config.TypeFlagPath + "/" + config.TypeFlag;
                excc.AddExtendConfig(xmlfilepath, dllfilepath, config);
            }
        }
コード例 #2
0
        ///// <summary>
        ///// 获取扩展配置对象
        ///// </summary>
        ///// <typeparam name="T"></typeparam>
        //public T ExtendConfig<T>()
        //{
        //    ECC ecc = MachineExConfig.GetExtendConfig();
        //    return (T)ecc.GetExtendConfig<T>();
        //}

        /// <summary>
        /// 添加扩展配置对象
        /// </summary>
        /// <param name="NewObject"></param>
        public void AddExtendConfig(object NewObject)
        {
            ECC ecc = MachineExConfig.GetExtendConfig();

            ecc.AddExtendConfig(NewObject);
        }