public void Unlock() { try { Console.WriteLine("unlock"); this.Hide(); this.tbPassword.Clear(); this.timer.Stop(); if (this.config.IsShowDesktop) { this.ToggleDesktop(false); } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } finally { Hooker.GetInstance().StopHook(); } try { //调用委托,执行父窗口的事件 this.doMonitor(); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } }
public void Lock() { try { Console.WriteLine("lock"); // 显示桌面 if (this.config.IsShowDesktop) { this.ToggleDesktop(true); } this.waitDuration = this.config.Locking * 60; this.tmpWaitDuration = this.waitDuration; this.RefreshCountDown(); this.timer.Start(); this.tbPassword.Visibility = Visibility.Hidden; this.Show(); // Hooker.GetInstance().StartHook(); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } }