private void Btn_Comfirm_MouseUp(object sender, MouseButtonEventArgs e)
        {
            Properties.Settings.Default.IsBtnCloseToExit         = (bool)RB_Exit.IsChecked;
            Properties.Settings.Default.IsBtnCloseNotNoticeAgain = (bool)CB_NotAskAgain.IsChecked;

            if ((bool)RB_Exit.IsChecked)
            {
                Bas.Exit();
            }
            else
            {
                Application.Current.MainWindow.Hide();
            }

            Close();
        }
예제 #2
0
 /// <summary>
 /// 关闭按钮鼠标弹起
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Btn_Close_MouseUp(object sender, MouseButtonEventArgs e)
 {
     if (Properties.Settings.Default.IsBtnCloseNotNoticeAgain)
     {
         if (Properties.Settings.Default.IsBtnCloseToExit)
         {
             Bas.Exit();
         }
         else
         {
             Hide();
         }
     }
     else
     {
         CloseBtnModeChoserWindow c = new CloseBtnModeChoserWindow();
         c.ShowDialog();
     }
 }
예제 #3
0
        /// <summary>
        /// 系统托盘图标初始化程序
        /// </summary>
        public static void NotifyIcon_Init()
        {
            NI = new System.Windows.Forms.NotifyIcon();

            NI.Icon = Properties.Resources.favicon;
            NI.Text = "录播姬";

            //打开菜单项
            System.Windows.Forms.MenuItem open = new System.Windows.Forms.MenuItem("显示主窗口");
            open.Click += new EventHandler((s, e) => { Application.Current.MainWindow.Show(); Application.Current.MainWindow.Activate(); });

            //设置菜单项
            System.Windows.Forms.MenuItem setting = new System.Windows.Forms.MenuItem("设置");
            setting.Click += new EventHandler((s, e) => { SettingWindow ss = new SettingWindow(); ss.Show(); });

            //检查更新菜单项
            System.Windows.Forms.MenuItem checkupdate = new System.Windows.Forms.MenuItem("检查更新");
            checkupdate.Click += new EventHandler((s, e) => { });

            //关于菜单项
            System.Windows.Forms.MenuItem about = new System.Windows.Forms.MenuItem("关于");
            about.Click += new EventHandler((s, e) => { AboutWindow a = new AboutWindow(); a.ShowDialog(); });

            //退出菜单项
            System.Windows.Forms.MenuItem exit = new System.Windows.Forms.MenuItem("退出");
            exit.Click += new EventHandler((s, e) => { Bas.Exit(); });

            //关联托盘控件
            System.Windows.Forms.MenuItem[] childen = new System.Windows.Forms.MenuItem[] { open, setting, checkupdate, about, exit };
            NI.ContextMenu = new System.Windows.Forms.ContextMenu(childen);

            NI.Click             += new EventHandler((s, e) => { Application.Current.MainWindow.Show(); Application.Current.MainWindow.Activate(); });
            NI.BalloonTipClicked += new EventHandler((s, e) => { Application.Current.MainWindow.Show(); Application.Current.MainWindow.Activate(); });

            NI.Visible = true;
        }
예제 #4
0
 /// <summary>
 /// 退出按钮点击
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Btn_Exit_Click(object sender, RoutedEventArgs e)
 {
     Bas.Exit();
 }