public NetCopy(IPAddress ipAddress, MainWindow mainWindow) { this.ipAddress = ipAddress; this.mainWindow = mainWindow; clipboardData = new ClipboardData(); clipboardData.SetClipboardText(); //SendData(); serverData = new ServerRequest(this.ipAddress); }
//Send clipboard text to server public void SendData() { if (!Clipboard.ContainsText()) { return; } if (isPasting) { return; } Console.WriteLine(" \nSENDING DATA..."); NetworkClient netClient = new NetworkClient(); clipboardData.SetClipboardText(); string data = clipboardData.GetSendedText(); string responseMessage = null; Thread clientThread = new Thread(() => netClient.StartClient(ipAddress, data, out responseMessage)); clientThread.Start(); }