Exemplo n.º 1
0
 void ProtectionCenterItemOnClick(object sender, EventArgs e)
 {
     if (WechatForm.Auth())
     {
         MainForm.Instance.SlideWindow(MainForm.Instance._protectionPanelControl);
     }
 }
Exemplo n.º 2
0
 void quitItemOnClick(object sender, EventArgs e)
 {
     if (WechatForm.Auth())
     {
         Application.Exit();
     }
 }
Exemplo n.º 3
0
 void customScanBtnOnClick(object sender, EventArgs e)
 {
     if (WechatForm.Auth())
     {
         MainForm.Instance.scanPanelControl.StartCustomScan();
     }
 }
Exemplo n.º 4
0
 static public WechatForm GetInstance()
 {
     if (SingleInstance == null || SingleInstance.IsDisposed)
     {
         SingleInstance = new WechatForm();
         //SingleInstance.TopMost = true;
     }
     return(SingleInstance);
 }
Exemplo n.º 5
0
 protected override void OnCreateMainForm()
 {
     MainForm = new MainForm(Environment.GetCommandLineArgs());
     //因为要操作主窗口,所以需要在主窗口生成以后
     if (Program.RealBindingSucess)
     {
         WechatForm.TurnOnAuth();
     }
 }
Exemplo n.º 6
0
        static void InitForBusinessLogic()
        {
            //如果数据库文件不存在,则建立数据库文件
            PornDatabase.CreateDatabase();
            PornClassifier.Init();
            FFMPEGWrapper.Init();
            WechatForm.Init();

            update_domain_list_timer = new System.Threading.Timer(PornDatabase.UpdateDatabase, null, new TimeSpan(0, 0, 5), new TimeSpan(4, 0, 0));
            delete_history_timer     = new System.Threading.Timer(PornDatabase.DeleteHistroy, null, new TimeSpan(0, 1, 0), System.Threading.Timeout.InfiniteTimeSpan);
        }
Exemplo n.º 7
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;
            }
        }
Exemplo n.º 8
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();
 }
Exemplo n.º 9
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;
     }
 }
Exemplo n.º 10
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();
            }
        }
Exemplo n.º 11
0
 void wechatBindingBtnOnClick(object sender, EventArgs e)
 {
     WechatForm.GetInstance().Show();
 }
Exemplo n.º 12
0
 protected override void OnCreateMainForm()
 {
     MainForm = WechatForm.GetInstance();
 }
Exemplo n.º 13
0
            void this_StartupNextInstance(object sender, StartupNextInstanceEventArgs e)
            {
                WechatForm form = MainForm as WechatForm; //My derived form type

                form.Show();
            }
 public static async Task SendPornScannedNotification(int picNum)
 {
     await WechatForm.SendPornScannedNotificationAsync(picNum.ToString());
 }
 public static async Task SendPornDetectedNotification(string domain_name)
 {
     await WechatForm.SendPornDetectedNotificationAsync(domain_name);
 }
 public static async Task SendUninstallNotification()
 {
     await WechatForm.SendUninstallNotificationAsync();
 }