コード例 #1
0
		private void OnSessionLock(object sender, SessionLockEventArgs e)
		{
			// Shutdown is handled through OnFormClosing (the default
			// WndProc of the Form class tries to close the window when
			// receiving WM_QUERYENDSESSION or WM_ENDSESSION)

			if((e.Reason == SessionLockReason.RemoteControlChange) &&
				Program.Config.Security.WorkspaceLocking.LockOnRemoteControlChange) { }
			else if(((e.Reason == SessionLockReason.Lock) ||
				(e.Reason == SessionLockReason.Ending) ||
				(e.Reason == SessionLockReason.UserSwitch)) &&
				Program.Config.Security.WorkspaceLocking.LockOnSessionSwitch) { }
			else if((e.Reason == SessionLockReason.Suspend) &&
				Program.Config.Security.WorkspaceLocking.LockOnSuspend) { }
			else return;

			if(IsAtLeastOneFileOpen()) LockAllDocuments();
		}
コード例 #2
0
ファイル: MainForm_Functions.cs プロジェクト: elitak/keepass
        private void OnSessionLock(object sender, SessionLockEventArgs e)
        {
            if((e.Reason == SessionLockReason.RemoteControlChange) &&
                Program.Config.Security.WorkspaceLocking.LockOnRemoteControlChange) { }
            else if(((e.Reason == SessionLockReason.Lock) || (e.Reason == SessionLockReason.Ending)) &&
                Program.Config.Security.WorkspaceLocking.LockOnSessionSwitch) { }
            else if((e.Reason == SessionLockReason.Suspend) &&
                Program.Config.Security.WorkspaceLocking.LockOnSuspend) { }
            else return;

            if(IsAtLeastOneFileOpen()) LockAllDocuments();
        }