OpenExeConfiguration() публичный статический Метод

public static OpenExeConfiguration ( ConfigurationUserLevel userLevel ) : Configuration
userLevel ConfigurationUserLevel
Результат Configuration
Пример #1
0
        public static void UpdateDailyAnnoucement(int h, int m, int s, int interval, int loops, string command)
        {
            Configuration config = ConfManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            string delim = ConfManager.AppSettings["AnnMess"] == "" ? "" : "|";

            string annMess     = ConfManager.AppSettings["AnnMess"] + delim + command;
            string annTime     = ConfManager.AppSettings["AnnTime"] + delim + h + ":" + m;
            string annLoops    = ConfManager.AppSettings["AnnLoops"] + delim + loops;
            string annInterval = ConfManager.AppSettings["AnnInterval"] + delim + interval;

            config.AppSettings.Settings["AnnMess"].Value     = annMess;
            config.AppSettings.Settings["AnnTime"].Value     = annTime;
            config.AppSettings.Settings["AnnLoops"].Value    = annLoops;
            config.AppSettings.Settings["AnnInterval"].Value = annInterval;
            config.Save(ConfigurationSaveMode.Modified);
            ConfManager.RefreshSection("appSettings");


            //TelepresenceScheduler.DeleteDailyAnnouncement();
            //LoadDailyAnnouncement();
            Action action = new Action(() =>
            {
                SpeechGeneration.SpeakAsync(command);
            });

            TelepresenceScheduler.DailyIntervalInSeconds(h, m, s, interval, loops, action);
        }
Пример #2
0
 static Cfg()
 {
     _conf    = ConfManager.OpenExeConfiguration(ConfigurationUserLevel.None);
     _section = (StartupFoldersConfigSection)_conf.GetSection("StartupFolders");
 }