Пример #1
0
        /// <summary>
        /// 创建实体工厂
        /// 数据库连接字符串
        /// 实体类适配器
        /// IDvTable
        /// </summary>
        protected virtual void CreateEntityFactory()
        {
            MachineDBInfo Dbh       = new MachineDBInfo();
            ProteinConfig pconfig   = ProteinConfig.GetInstance();
            string        entityftc = pconfig.DAlEntityConfig.EntityFactory;
            ClassDrive    cd        = new Design.ClassDrive();

            entityFac = cd.Instance <IEntityFactory>(pconfig.DAlEntityConfig.AssemblyName.ExtComposeAssemblyFullName(), entityftc, Dbh);
        }
Пример #2
0
        /// <summary>
        /// 创建日志记录器
        /// </summary>
        /// <returns></returns>
        protected static ILogger CreateLogger()
        {
            ProteinConfig pconfig      = ProteinConfig.GetInstance();
            string        aname        = pconfig.DAlEntityConfig.AssemblyName;
            string        assemblyfile = aname.ExtComposeAssemblyFullName();

            Design.ClassDrive cd     = new Design.ClassDrive();
            ILogger           logger = cd.Instance <ILogger>(assemblyfile, pconfig.DAlEntityConfig.ProteinLog);// LoggerManager.CreateLogger(assemblyfile, pconfig.DAlEntityConfig.ProteinLog);

            logger.EntityFactory = MachineEntityHandler.GetEntityFactory();
            return(logger);
        }
Пример #3
0
        public virtual ProxyInterceptor Antipod()
        {
            //类库配置
            ProteinConfig pconfig = ProteinConfig.GetInstance();
            //代理拦截器
            ProxyInterceptor pri = new ProxyInterceptor();
            ProxyDefaul      pd  = new ProxyDefaul();

            //对拦截器的机制进行初始化
            pd.SetProxy(pri);
            return(pri);
        }
Пример #4
0
        /// <summary>
        /// 设置扩展配置
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="Obj"></param>
        public static void SetExtendConfig <T>(T Obj)
        {
            ProteinConfig pconfig = ProteinConfig.GetInstance();
            ECC           ecc     = MachineExConfig.GetExtendConfig();

            foreach (ExConfig config in pconfig.ExConfigs)
            {
                if (config.Name == typeof(T).FullName)
                {
                    ecc.SaveExtendConfig <T>(config.GetType().Assembly.GetAssemblyPath() + config.ConfigXMLPath + "\\" + config.ConfigXML, Obj);
                }
            }
        }
Пример #5
0
        /// <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);
            }
        }
Пример #6
0
        public string GetConnectString()
        {
            ProteinConfig pconfig = ProteinConfig.GetInstance();

            if (!pconfig.DataBaseConfig.Secrecy)
            {
                //OutputDecryptString(pconfig.DataBaseConfig.ConnectionStr);
                return(pconfig.DataBaseConfig.ConnectionStr);
            }
            else
            {
                return(pconfig.DataBaseConfig.ConnectionStr.CipherDecryptDES());
            }
        }
Пример #7
0
 /// <summary>
 /// 支撑类库配置
 /// </summary>
 /// <returns></returns>
 public static ProteinConfig GetProteinConfig()
 {
     return(ProteinConfig.GetInstance());
 }