Exemplo n.º 1
0
 /// <summary>
 /// 返回配置类实例
 /// </summary>
 /// <returns></returns>
 public static RabbitMQConfigInfo LoadConfig()
 {
     if (Utils.FileExists(ConfigFilePath))
     {
         ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo);
         return(ConfigInfo as RabbitMQConfigInfo);
     }
     else
     {
         return(null);
     }
 }
 /// <summary>
 /// 返回配置类实例
 /// </summary>
 /// <returns></returns>
 public static MyAttachmentsTypeConfigInfo LoadConfig()
 {
     try
     {
         ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, true);
     }
     catch
     {
         ReviseConfig();
         ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, true);
     }
     return(ConfigInfo as MyAttachmentsTypeConfigInfo);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 返回配置类实例
 /// </summary>
 /// <returns></returns>
 public static GeneralConfigInfo LoadConfig()
 {
     try
     {
         ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, true);
     }
     catch
     {
         ReviseConfig();
         ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, true);
     }
     return(ConfigInfo as GeneralConfigInfo);
 }
Exemplo n.º 4
0
        /// <summary>
        /// 返回配置类实例
        /// </summary>
        /// <returns></returns>
        public static ScriptEventConfigInfo LoadConfig()
        {
            try
            {
                ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, false);
            }
            catch {
                if (!File.Exists(ConfigFilePath))
                {
                    ScriptEventConfigFileManager secf = new ScriptEventConfigFileManager();
                    secf.SaveConfig(ConfigFilePath, ConfigInfo);
                }
            }

            return(ConfigInfo as ScriptEventConfigInfo);
        }
        /// <summary>
        /// 初始化文件修改时间和对象实例
        /// </summary>
        static MyAttachmentsTypeConfigFileManager()
        {
            m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);

            try
            {
                m_configinfo = (MyAttachmentsTypeConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(MyAttachmentsTypeConfigInfo));
            }
            catch
            {
                if (File.Exists(ConfigFilePath))
                {
                    ReviseConfig();
                    m_configinfo = (MyAttachmentsTypeConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(MyAttachmentsTypeConfigInfo));
                }
            }
        }
 /// <summary>
 /// 加载配置类
 /// </summary>
 /// <returns></returns>
 public static BaseConfigInfo LoadConfig()
 {
     ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo);
     return(ConfigInfo as BaseConfigInfo);
 }
 /// <summary>
 /// 初始化文件修改时间和对象实例
 /// </summary>
 static BaseConfigFileManager()
 {
     m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);
     m_configinfo    = (BaseConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(BaseConfigInfo));
 }
Exemplo n.º 8
0
 /// <summary>
 /// 返回配置类实例
 /// </summary>
 /// <returns></returns>
 public static DiscuzCloudConfigInfo LoadConfig()
 {
     ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileOldChange, ConfigFilePath, ConfigInfo);
     return(ConfigInfo as DiscuzCloudConfigInfo);
 }
Exemplo n.º 9
0
 /// <summary>
 /// 返回配置类实例
 /// </summary>
 /// <returns></returns>
 public static ScheduleConfigInfo LoadConfig()
 {
     ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, true);
     return(ConfigInfo as ScheduleConfigInfo);
 }