/// <summary> /// Sets the directories the discard program will enumerate over /// </summary> /// <param name="directories"></param> public static void SetDiscardDirectories(IEnumerable <string> directories) { Properties.Settings.Default.DiscardDirs = string.Join(">", directories); Properties.Settings.Default.Save(); //Update FSWatcher _watcher?.Dispose(); _watcher = new FSWatcher(); }
public static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Microsoft.Win32.SystemEvents.SessionSwitch += (s, e) => { if (e.Reason == Microsoft.Win32.SessionSwitchReason.SessionUnlock) { _icon.UpdateIcon(); RunOnAwake(); } }; _icon = new DiscardNotifyIcon(); _icon.Show(); _watcher = new FSWatcher(); RunOnAwake(); Application.Run(); }