/// <inheritdoc/> protected override void WndProc(ref Message m) { if (AllowClipboardSharingToServer && m.Msg == WM_CLIPBOARDUPDATE) { string clipboard = ""; try { if (Clipboard.ContainsText()) { clipboard = Clipboard.GetText(); } } catch (ExternalException) { } if (clipboard.Length != 0) { if (_client != null && clipboard != _expectedClipboard) { _expectedClipboard = clipboard; _client.SendLocalClipboardChange(clipboard); } } } base.WndProc(ref m); }
public void SendLocalClipboardChangeNullTest() { VncClient client = new VncClient(); Assert.Throws <ArgumentNullException>(() => client.SendLocalClipboardChange(null)); }