コード例 #1
0
 void customScanBtnOnClick(object sender, EventArgs e)
 {
     if (WechatForm.Auth())
     {
         MainForm.Instance.scanPanelControl.StartCustomScan();
     }
 }
コード例 #2
0
 void ProtectionCenterItemOnClick(object sender, EventArgs e)
 {
     if (WechatForm.Auth())
     {
         MainForm.Instance.SlideWindow(MainForm.Instance._protectionPanelControl);
     }
 }
コード例 #3
0
 void quitItemOnClick(object sender, EventArgs e)
 {
     if (WechatForm.Auth())
     {
         Application.Exit();
     }
 }
コード例 #4
0
        private void TurnOffAutoStart()
        {
            RegistryKey autorun_registry_key = Registry.CurrentUser.OpenSubKey(kAutoRunRegisstryKey, true);

            if (WechatForm.Auth())
            {
                //autorun_registry_key.DeleteValue(kAutoRunKey);
                autorun_registry_key.SetValue(kAutoRunKey, "");
                ToolStripMenuItemAutoStartToggleOnff.Checked = false;
                //mainAutoStartToolStripMenuItem.Checked = false;
            }
        }
コード例 #5
0
 private void QuitToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //authenticate by wechat
     log.Info("Auth for Quit!");
     if (WechatForm.Auth())
     {
         //exitMailTask = NotificationRoutines.SendExitNotification();
         log.Info("auth success!");
         IsRealQuit = true;
         Application.Exit();
     }
     //this.Close();
 }
コード例 #6
0
 void MainFormOnFormClosing(object sender, FormClosingEventArgs e)
 {
     log.Info("MainForm Closing: " + e.CloseReason.ToString());
     //if (!(e.CloseReason == CloseReason.) !ForceToQuit && !WechatForm.Auth())
     if (e.CloseReason == CloseReason.UserClosing || e.CloseReason == CloseReason.TaskManagerClosing)
     //|| e.CloseReason == CloseReason.WindowsShutDown)
     {
         if (!WechatForm.Auth())
         {
             e.Cancel = true;
         }
     }
     else if (e.CloseReason == CloseReason.WindowsShutDown)
     {
         Program.kCloseReason = e.CloseReason;
     }
 }
コード例 #7
0
        private void TurnOffProxy()
        {
            if (WechatForm.Auth())
            {
#if !DEBUG
                //ProxyRoutines.SetProxy(false);
                SystemProxyHelper.DisableAllProxy();
                FireFoxHelper.RemoveFirefox();
#endif
                //notify_icon_main.Icon = Properties.Resources.off;
                tool_strip_menu_item_toggle_onff.Checked = false;
                //toggleOnOffButton.Image = Properties.Resources.powerblack_small;
                Properties.Settings.Default.isProtected = false;
                Properties.Settings.Default.Save();
                //同时设置
                TurnOffAutoStart();
            }
        }