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(); }
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(); }