/// <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); }
/// <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); }
public virtual ProxyInterceptor Antipod() { //类库配置 ProteinConfig pconfig = ProteinConfig.GetInstance(); //代理拦截器 ProxyInterceptor pri = new ProxyInterceptor(); ProxyDefaul pd = new ProxyDefaul(); //对拦截器的机制进行初始化 pd.SetProxy(pri); return(pri); }
/// <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); } } }
/// <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); } }
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()); } }
/// <summary> /// 支撑类库配置 /// </summary> /// <returns></returns> public static ProteinConfig GetProteinConfig() { return(ProteinConfig.GetInstance()); }