예제 #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);
            };
        }
예제 #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);
    }
예제 #4
0
 internal Task CloseAsync(DrawerRef drawerRef)
 {
     if (OnCloseEvent != null)
     {
         return(OnCloseEvent.Invoke(drawerRef));
     }
     return(Task.CompletedTask);
 }
예제 #5
0
        public void Close()
        {
            Stream.Close();
            Socket.Close();

            // Tells the subscribers of this event that this connection has been closed.
            OnCloseEvent?.Invoke(this);
        }
예제 #6
0
 internal Task CloseAsync(ConfirmRef confirmRef)
 {
     if (OnCloseEvent != null)
     {
         return(OnCloseEvent.Invoke(confirmRef));
     }
     return(Task.CompletedTask);
 }
예제 #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();
        }
예제 #9
0
        protected override void OnClose(CloseEventArgs e)
        {
            _serverSocket.OnUpdateEvent -= Update;

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

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