Пример #1
0
 /// <summary>
 /// 读取配置文件来生成依赖注入
 /// </summary>
 public void RegisterTypeFromConfig(string path)
 {
     MYIocConfigManager.GetInstance(path).GetMYIoc().GetRegisters().ToList().ForEach(s =>
     {
         this.RegisterType(s);
     });
 }
Пример #2
0
        public static MYIocConfigManager GetInstance(string path)
        {
            object lockObj = new object();

            lock (lockObj) if (instance == null || cfgPath != path)
                {
                    instance = new MYIocConfigManager(path);
                }
            return(instance);
        }
Пример #3
0
 public static MYIocConfigManager GetInstance(string path)
 {
     object lockObj = new object();
     lock (lockObj) if (instance == null || cfgPath != path) instance = new MYIocConfigManager(path);
     return instance;
 }