Example #1
0
        public LKLockScreen()
        {
            InitializeComponent();

            //图案解锁事件订阅
            screenUnlock.OnCheckedPoint  += ScreenUnlock_OnCheckedPoint;
            screenUnlock.OnRememberPoint += ScreenUnlock_OnRememberPoint;

            //键盘解锁,安装键盘钩子
            KeyboardHook keyboardHook = KeyboardHook.GetInstance();

            keyboardHook.SetHook();
            numUnlock.UnLockStateEvent  += NumUnlock_UnLockStateEvent;
            keyboardHook.OnKeyDownEvent += KeyboardHook_OnKeyDownEvent;
            keyboardHook.OnKeyUpEvent   += KeyboardHook_OnKeyUpEvent;

            //屏蔽任务管理器
            Win32Api.ManageTaskManager(1);

            this.DataContext = MainWindow.VM;

            //初始化背景
            InitBackground();

            this.Closed += (s, e) =>
            {
                //返回1,关闭窗口
                keyboardHook.UnHook();
                OnCloseEvent?.Invoke(1, new EventArgs());
                keyboardHook.OnKeyDownEvent -= KeyboardHook_OnKeyDownEvent;
                keyboardHook.OnKeyUpEvent   -= KeyboardHook_OnKeyUpEvent;
                Win32Api.ManageTaskManager(0);
            };
        }
Example #2
0
    private static bool HandlerRoutine(CtrlType ctrlType)
    {
        switch (ctrlType)
        {
        case CtrlType.CTRL_C_EVENT:
            OnCtrlCEvent?.Invoke();
            break;

        case CtrlType.CTRL_BREAK_EVENT:
            OnCtrlBreakEvent?.Invoke();
            break;

        case CtrlType.CTRL_CLOSE_EVENT:
            OnCloseEvent?.Invoke();
            break;

        case CtrlType.CTRL_LOGOFF_EVENT:
            OnLogoffEvent?.Invoke();
            break;

        case CtrlType.CTRL_SHUTDOWN_EVENT:
            OnShutDownEvent?.Invoke();
            break;
        }
        OnAllEvent?.Invoke();
        InitEvents();
        _canExit = true;
        SetConsoleCtrlHandler(HandlerRoutine, false);
        Environment.Exit(0);
        return(true);
    }
    private void OnClosePressed()
    {
        OnCloseEvent?.Invoke();
        contentAnimator.Hide(true);

        AudioScriptableObjects.dialogClose.Play(true);
    }
Example #4
0
 internal Task CloseAsync(DrawerRef drawerRef)
 {
     if (OnCloseEvent != null)
     {
         return(OnCloseEvent.Invoke(drawerRef));
     }
     return(Task.CompletedTask);
 }
Example #5
0
        public void Close()
        {
            Stream.Close();
            Socket.Close();

            // Tells the subscribers of this event that this connection has been closed.
            OnCloseEvent?.Invoke(this);
        }
 internal Task CloseAsync(ConfirmRef confirmRef)
 {
     if (OnCloseEvent != null)
     {
         return(OnCloseEvent.Invoke(confirmRef));
     }
     return(Task.CompletedTask);
 }
Example #7
0
 internal Task CloseAsync(ModalRef modalRef)
 {
     if (OnCloseEvent != null)
     {
         return(OnCloseEvent.Invoke(modalRef));
     }
     return(Task.CompletedTask);
 }
        protected override void OnClosed(EventArgs e)
        {
            OnCloseEvent?.Invoke();

            base.OnClosed(e);

            Application.Current.Shutdown();
        }
Example #9
0
        protected override void OnClose(CloseEventArgs e)
        {
            _serverSocket.OnUpdateEvent -= Update;

            _serverSocket.ExecuteOnUpdate(() =>
            {
                OnCloseEvent?.Invoke(e.Reason);
            });
        }
            protected override void OnClose(CloseEventArgs e)
            {
                _serverSocket.OnUpdate -= Update;

                _serverSocket.ExecuteOnUpdate(() =>
                {
                    if (OnCloseEvent != null)
                        OnCloseEvent.Invoke(e.Reason);
                });
            }
Example #11
0
 private void DismissButton_OnClick(object sender, RoutedEventArgs e)
 {
     StopRenderingAndClearCache();
     OnCloseEvent?.Invoke(this, EventArgs.Empty);
 }
Example #12
0
 public virtual void OnClose()
 {
     OnCloseFunc?.Invoke();
     OnCloseEvent?.Invoke();
 }
Example #13
0
 private void LKLockScreen_Closed(object sender, EventArgs e)
 {
     //返回1,关闭窗口
     OnCloseEvent?.Invoke(1, new EventArgs());
 }
Example #14
0
 private void OnClosePressed()
 {
     OnCloseEvent?.Invoke();
     contentAnimator.Hide(true);
 }
 protected virtual void OnClosed()
 {
     OnCloseEvent?.Invoke();
 }
Example #16
0
 protected virtual void OnClientClose(SessionBase newClient)
 {
     OnCloseEvent?.Invoke(newClient);
 }