public SessionWindow(MainListObject ClientObject) { InitializeComponent(); Client = ClientObject; Imagee.Source = Client.Image; this.Topmost = true; }
private void Image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { MainListObject obj = (MainListObject)(sender as System.Windows.Controls.Image).DataContext; FastIP = obj.IP; SendFastTransmissionRequest(obj.IP); SessionWindow NewOne = new SessionWindow((MainListObject)(sender as System.Windows.Controls.Image).DataContext); sesWindow = NewOne; Global.SessionWin = NewOne; NewOne.Show(); }
private void ShowPrcesess_Click(object sender, RoutedEventArgs e) { MainListObject obj = (MainListObject)(sender as Button).DataContext; try { IPAddress IPC = IPAddress.Parse(obj.IP); IPEndPoint FastClient = new IPEndPoint(IPC, 12414); EndPoint FastClientEP = (EndPoint)(FastClient); string MessageSTR = "SHOWPROCESESS"; byte[] MessageToSent = GetBytes(MessageSTR); Server2.SendTo(MessageToSent, FastClientEP); } catch (Exception ex) { } }
void FirstBackgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { ReceivedObject obj = (ReceivedObject)e.UserState; Bitmap a = obj.Image; string IP = obj.IP; if (mainlist.Exists(aa => aa.IP == IP)) { ((MainListObject)mainlist.Find(b => b.IP == IP)).Image = ToBitmapImage(a); } else { MainListObject neww = new MainListObject(); neww.IP = IP; neww.Image = ToBitmapImage(a); neww.port = obj.port + 1; mainlist.Add(neww); } }