static void Main() { TaskBarUtil.CheckCreated(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }
private void Exit_Click(object sender, EventArgs e) { if (System.Windows.MessageBox.Show("确定要关闭吗?", "退出", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes) { notifiy.Dispose(); TaskBarUtil.RefreshNotificationArea(); System.Windows.Application.Current.Shutdown(); } }
/// <summary> /// 初始化界面 /// </summary> private void InitializeUI() { //Title = $"必应每日壁纸2 version_{SuperEngine.Current.Version}(预览版)"; cbImageSize.ItemsSource = CoreEngine.Current.ImageSizeList; cbImageSize.DisplayMemberPath = "Name"; cbImageSize.SelectedIndex = CoreEngine.Current.ImageSizeList.ToList().FindIndex(s => s.Type == CoreEngine.Current.AppSetting.GetSizeMode); cbWallpaperStyle.ItemsSource = CoreEngine.Current.WallpaperStyleList; cbWallpaperStyle.DisplayMemberPath = "Name"; cbWallpaperStyle.SelectedIndex = CoreEngine.Current.WallpaperStyleList.ToList().FindIndex(s => s.Type == CoreEngine.Current.AppSetting.GetStyleMode); SetAppBackground(); //ImgPreview.Source = new WPFSupportFormat().ChangeBitmapToImageSource( CoreEngine.Current.GetWallpaperImage()); _doNotInvokeCheckMethod = false; PackUp(_isPackUp); //设置托盘图标 taskBarUtil = new TaskBarUtil(this); }
private void App_Exit(object sender, ExitEventArgs e) { notifiy.Dispose(); TaskBarUtil.RefreshNotificationArea(); }