/// <summary>
        /// 保存配置类实例
        /// </summary>
        /// <returns></returns>
        public static bool SaveConfig(ScheduleConfigInfo scheduleconfiginfo)
        {
            ScheduleConfigFileManager scfm = new ScheduleConfigFileManager();

            ScheduleConfigFileManager.ConfigInfo = scheduleconfiginfo;
            return(scfm.SaveConfig());
        }
        public Result Delete(string Key)
        {
            ScheduleConfigInfo sci = ScheduleConfigs.GetConfig();

            sci.Events = sci.Events.Where(p => p.Key != Key).ToArray();
            ScheduleConfigs.SaveConfig(sci);
            return(new Result(true));
        }
 /// <summary>
 /// 初始化文件修改时间和对象实例
 /// </summary>
 static ScheduleConfigFileManager()
 {
     m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);
     m_configinfo    = (ScheduleConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(ScheduleConfigInfo));
 }
Example #4
0
 /// <summary>
 /// 初始化文件修改时间和对象实例
 /// </summary>
 static ScheduleConfigFileManager()
 {
     m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);
     m_configinfo = (ScheduleConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(ScheduleConfigInfo));
 }
Example #5
0
 /// <summary>
 /// 保存配置类实例
 /// </summary>
 /// <returns></returns>
 public static bool SaveConfig(ScheduleConfigInfo scheduleconfiginfo)
 {
     ScheduleConfigFileManager scfm = new ScheduleConfigFileManager();
     ScheduleConfigFileManager.ConfigInfo = scheduleconfiginfo;
     return scfm.SaveConfig();
 }