private static void Init() { CustomConfigSection customConfig = (CustomConfigSection)ConfigurationManager.GetSection("CustomConfigSection"); using (CustomConfigSectionManager customConfigSectionManager = new CustomConfigSectionManager()) { CultureElement culture = customConfigSectionManager.GetCurrentCulture(); Thread.CurrentThread.CurrentUICulture = new CultureInfo(Convert.ToInt32(culture.Name.ToString("D"))); Id = customConfigSectionManager.GetCurrentCount(); Rules = customConfigSectionManager.GetRules(); watchersLst = new List <FileSystemWatcher>(); foreach (DirectoryElement item in customConfigSectionManager.GetDirectories()) { watchersLst.Add(CreateWatcher(item.Path, Watcher_Changed)); } } }
public SecEventChecker() { section = ConfigurationManager.GetSection("appsettings") as CustomConfigSection; InitializeComponent(); }
public Checker() { CustomConfigSection section = ConfigurationManager.GetSection("appsettings") as CustomConfigSection; _timepsan = section.Timespan; }