示例#1
0
        /// <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);
        }
示例#2
0
        public void SendLocalClipboardChangeNullTest()
        {
            VncClient client = new VncClient();

            Assert.Throws <ArgumentNullException>(() => client.SendLocalClipboardChange(null));
        }