private void FullScreenHandler(object sender, SubscribedKeyPressEventArgs e) { if (this.InvokeRequired) { EventHandler <SubscribedKeyPressEventArgs> d = new EventHandler <SubscribedKeyPressEventArgs>(FullScreenHandler); ((RemoteDesktopClientForm)d.Target).Invoke(d, sender, e); return; } if (this.FormBorderStyle == System.Windows.Forms.FormBorderStyle.None) { this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable; this.TopMost = mTopMostStateBeforeFullScreen; this.DesktopBounds = mBoundaryBeforeFullScreen; this.WindowState = mPreviousWindowState; fullScreenToolStripMenuItem.Text = Resources.cmFullScreen; } else { mPreviousWindowState = this.WindowState; mTopMostStateBeforeFullScreen = this.TopMost; mBoundaryBeforeFullScreen = this.DesktopBounds; Screen currentScreen = Screen.FromControl(this); this.WindowState = FormWindowState.Normal; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.TopMost = true; this.DesktopBounds = currentScreen.Bounds; fullScreenToolStripMenuItem.Text = Resources.cmFullScreenExit; } }
private void Event_KeyUp(object sender, KeyEventArgs e) { ListSpecialized <EventHandler <SubscribedKeyPressEventArgs> > subscribeds = null; KeysSubscription k = new KeysSubscription(e.KeyCode, e.Alt, e.Control, e.Shift); lock (mKeysSubscriptions) { if (mKeysSubscriptions.ContainsKey(k)) { subscribeds = new ListSpecialized <EventHandler <SubscribedKeyPressEventArgs> >(mKeysSubscriptions[k]); } } if (subscribeds != null) { SubscribedKeyPressEventArgs arg = new SubscribedKeyPressEventArgs(k); foreach (EventHandler <SubscribedKeyPressEventArgs> handler in subscribeds) { Raiser.CallDelegatorBySync(handler, new object[] { this, arg }); } } else { IRemoteDesktopClientInternal proxy = mProxy; if (proxy != null && proxy.IsActive) { try { proxy.ClientSendKeyEvent(new KeyboardEventArgs(KeyboardEventTypeEnum.Up, e.KeyCode)); } catch (Exception) { } } //LogKeyEvent(sender, "KEY-UP", e); } }
private void ShowMenu(object sender, SubscribedKeyPressEventArgs e) { if (this.InvokeRequired) { EventHandler <SubscribedKeyPressEventArgs> d = new EventHandler <SubscribedKeyPressEventArgs>(ShowMenu); ((RemoteDesktopClientForm)d.Target).Invoke(d, sender, e); return; } cmRemoteDesktopMenu.Show(Cursor.Position); }