| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 | 
							- using System;
 
- using System.Collections.Generic;
 
- using System.Linq;
 
- using System.Text;
 
- using Aitex.Core.RT.Log;
 
- namespace Aitex.Core.RT.ConfigCenter
 
- {
 
-     public class ConfigItem
 
-     {
 
-         public object this[string configName]
 
-         {
 
-             get
 
-             {
 
-                 return CONFIG.Get(configName);
 
-             }
 
-             set
 
-             {
 
-                 CONFIG.Set(configName, value);
 
-             }
 
-         }
 
-     }
 
-     public class CONFIG
 
-     {
 
-         public static ConfigItem Items = new ConfigItem();
 
-         public static ICommonConfig InnerConfigManager { set; private get; }
 
-         public static object Get(string configName)
 
-         {
 
-             return (InnerConfigManager != null) ? InnerConfigManager.GetConfig(configName) : null;
 
-         }
 
-         public static void Set(string configName, object value)
 
-         {
 
-             if (InnerConfigManager != null)
 
-                 InnerConfigManager.SetConfig(configName, value);
 
-         }
 
-         /// <summary>
 
-         /// 返回Config目录下面文件的内容,filename也可以是绝对路径
 
-         /// 如果文件不存在,返回NULL。
 
-         /// 如果读取错误,返回""
 
-         /// </summary>
 
-         /// <param name="fileName"></param>
 
-         /// <returns></returns>
 
-         public static string GetFileContent(string fileName)
 
-         {
 
-             if (InnerConfigManager != null)
 
-                 return InnerConfigManager.GetFileContent(fileName);
 
-             //LOG.Error("Config模块没有初始化,调用GetConfigFile()" + fileName);
 
-             return null;
 
-         }
 
-         public static void Subscribe(string module, string key, Func<object> getter)
 
-         {
 
-             if (InnerConfigManager != null)
 
-                 InnerConfigManager.Subscribe(module, key, getter);
 
-         }
 
-         public static object Poll(string paramName)
 
-         {
 
-             return (InnerConfigManager == null) ? null : InnerConfigManager.Poll(paramName);
 
-         }
 
-         public static object Poll(string module, string paramName)
 
-         {
 
-             return (InnerConfigManager == null) ? null : InnerConfigManager.Poll(string.Format("{0}.{1}", module, paramName));
 
-         }
 
-         public static Dictionary<string, object> PollConfig(IEnumerable<string> keys)
 
-         {
 
-             return (InnerConfigManager == null) ? null : InnerConfigManager.PollConfig(keys);
 
-         }
 
-     }
 
- }
 
 
  |