public MainWindow() { PathWorker.WallpaperPathWorker(); InitializeComponent(); DateTime localDate1 = DateTime.Now; String minute = localDate1.ToString("mm", new CultureInfo("en-US")); String second = localDate1.ToString("ss", new CultureInfo("en-US")); int trueMinute = 0; int trueSeconds = 60 - Convert.ToInt16(second); DayChangeLogic.timer.Tick += new EventHandler(DayChangeLogic.timerTick); DayChangeLogic.timer.Interval = new TimeSpan(0, trueMinute, trueSeconds); DayChangeLogic.timer.Start(); System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon(); ni.Icon = new System.Drawing.Icon("fire-2-24.ico"); ni.Visible = true; System.Windows.Forms.ContextMenu myMenu1 = new System.Windows.Forms.ContextMenu(); myMenu1.MenuItems.Add("Настройки", new EventHandler(FormShow)); myMenu1.MenuItems.Add("About", new EventHandler(OpenGithub)); myMenu1.MenuItems.Add("Выход", new EventHandler(FormExit)); ni.ContextMenu = myMenu1; ni.DoubleClick += new EventHandler(FormShow); }
private void ButtonDaySet_Click(object sender, RoutedEventArgs e) { int DayIndex = ComboBoxDayOfWeek.SelectedIndex; switch (DayIndex) { case 0: PathWorker.WallpaperPathChanger(TextBoxWallpaperPath.Text, DayIndex); break; case 1: PathWorker.WallpaperPathChanger(TextBoxWallpaperPath.Text, DayIndex); break; case 2: PathWorker.WallpaperPathChanger(TextBoxWallpaperPath.Text, DayIndex); break; case 3: PathWorker.WallpaperPathChanger(TextBoxWallpaperPath.Text, DayIndex); break; case 4: PathWorker.WallpaperPathChanger(TextBoxWallpaperPath.Text, DayIndex); break; case 5: PathWorker.WallpaperPathChanger(TextBoxWallpaperPath.Text, DayIndex); break; case 6: PathWorker.WallpaperPathChanger(TextBoxWallpaperPath.Text, DayIndex); break; } PathWorker.WallpaperPathWriter(); }