Esempio n. 1
0
        private static System.Timers.Timer rabbitMQConfigTimer = new System.Timers.Timer(600000); //间隔为10分钟

        #endregion Fields

        #region Constructors

        static RabbitMQConfigs()
        {
            m_configinfo = RabbitMQConfigFileManager.LoadConfig();
            rabbitMQConfigTimer.AutoReset = true;
            rabbitMQConfigTimer.Enabled = true;
            rabbitMQConfigTimer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
            rabbitMQConfigTimer.Start();
        }
Esempio n. 2
0
 /// <summary>
 /// 初始化文件修改时间和对象实例
 /// </summary>
 static RabbitMQConfigFileManager()
 {
     if (Utils.FileExists(ConfigFilePath))
     {
         m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);
         m_configinfo = (RabbitMQConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(RabbitMQConfigInfo));
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 保存配置类实例
 /// </summary>
 /// <param name="configinfo"></param>
 /// <returns></returns>
 public static bool SaveConfig(RabbitMQConfigInfo configinfo)
 {
     RabbitMQConfigFileManager rmcfm = new RabbitMQConfigFileManager();
     RabbitMQConfigFileManager.ConfigInfo = configinfo;
     return rmcfm.SaveConfig();
 }
Esempio n. 4
0
 /// <summary>
 /// 重设配置类实例
 /// </summary>
 public static void ResetConfig()
 {
     m_configinfo = RabbitMQConfigFileManager.LoadConfig();
 }