/// <summary>
 /// 序列化配置信息为XML
 /// </summary>
 /// <param name="configinfo">配置信息</param>
 /// <param name="configFilePath">配置文件完整路径</param>
 public static InvitationConfigInfo Serialiaze(InvitationConfigInfo configinfo, string configFilePath)
 {
     lock (lockHelper)
     {
         SerializationHelper.Save(configinfo, configFilePath);
     }
     return configinfo;
 }
 /// <summary>
 /// 序列化配置信息为XML
 /// </summary>
 /// <param name="configinfo">配置信息</param>
 /// <param name="configFilePath">配置文件完整路径</param>
 public static InvitationConfigInfo Serialiaze(InvitationConfigInfo configinfo, string configFilePath)
 {
     lock (lockHelper)
     {
         SerializationHelper.Save(configinfo, configFilePath);
     }
     return(configinfo);
 }
        /// <summary>
        /// 静态构造函数初始化相应实例和定时器
        /// </summary>
        static InvitationConfigs()
        {
            m_configinfo = InvitationConfigFileManager.LoadConfig();

            invitationConfigTimer.AutoReset = true;
            invitationConfigTimer.Enabled = true;
            invitationConfigTimer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
            invitationConfigTimer.Start();
        }
        /// <summary>
        /// 静态构造函数初始化相应实例和定时器
        /// </summary>
        static InvitationConfigs()
        {
            m_configinfo = InvitationConfigFileManager.LoadConfig();

            invitationConfigTimer.AutoReset = true;
            invitationConfigTimer.Enabled   = true;
            invitationConfigTimer.Elapsed  += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
            invitationConfigTimer.Start();
        }
        /// <summary>
        /// 初始化文件修改时间和对象实例
        /// </summary>
        static InvitationConfigFileManager()
        {
            m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);

            try
            {
                m_configinfo = (InvitationConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(InvitationConfigInfo));
            }
            catch
            {
                if (File.Exists(ConfigFilePath))
                {
                    ReviseConfig();
                    m_configinfo = (InvitationConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(InvitationConfigInfo));
                }
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 初始化文件修改时间和对象实例
        /// </summary>
        static InvitationConfigFileManager()
        {
            m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);

            try
            {
                m_configinfo = (InvitationConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(InvitationConfigInfo));
            }
            catch
            {
                if (File.Exists(ConfigFilePath))
                {
                    ReviseConfig();
                    m_configinfo = (InvitationConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(InvitationConfigInfo));
                }
            }
        }
 /// <summary>
 /// 重设配置类实例
 /// </summary>
 public static void ResetConfig()
 {
     m_configinfo = InvitationConfigFileManager.LoadConfig();
 }
 /// <summary>
 /// 重设配置类实例
 /// </summary>
 public static void ResetConfig()
 {
     m_configinfo = InvitationConfigFileManager.LoadConfig();
 }