public void Start() { if (ConfigList != null) { ConfigList.Clear(); } GC.Collect(); ConfigList = EmailHelper.GetConfigsFormConfig(); taskThread = new Task(ThreadOfEmail); taskThread.Start(); }
private void LoadConfigurations() { var systemPath = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData); // string[] filePaths = Directory.GetFiles(systemPath); ConfigList.Clear(); foreach (var file in Directory.EnumerateFiles(systemPath, "*.xml")) { string fileName_ = file.ToString().Replace(systemPath.ToString() + "\\", ""); fileName_ = fileName_.Replace(".xml", ""); ConfigList.Add(fileName_); } }