Example #1
0
 public GetRequests(SendVideo sendVideo, ReceiveVideo receiveVideo, delegateUpdateListUsers eventUpdateListUsers, PictureBox pb_Video, string myUserName)
 {
     listUsersNames            = new List <string>();
     listUsersIp               = new List <string>();
     this.myUserName           = myUserName;
     this.sendVideo            = sendVideo;
     this.receiveVideo         = receiveVideo;
     threadGetRequests         = new Thread(GetRequest);
     this.eventUpdateListUsers = eventUpdateListUsers;
     this.pb_Video             = pb_Video;
 }
 private void BeginInitializeParams()
 {
     LoadSetting();
     eventThreadSendVideo    = new AutoResetEvent(false);
     eventThreadReceiveVideo = new AutoResetEvent(false);
     if (tS_CB_Cameras.SelectedIndex != -1)
     {
         sendVideo = new SendVideo(videoCaptureDiveses[tS_CB_Cameras.SelectedIndex].MonikerString, GetHostIP(), pb_Video, eventThreadReceiveVideo, eventThreadSendVideo);
     }
     else
     {
         sendVideo = new SendVideo("default", GetHostIP(), pb_Video, eventThreadReceiveVideo, eventThreadSendVideo);
     }
     receiveVideo          = new ReceiveVideo(pb_Video, eventThreadSendVideo, eventThreadReceiveVideo);
     eventUpdateListUsers += UpdateListUsers;
     getRequests           = new GetRequests(sendVideo, receiveVideo, eventUpdateListUsers, pb_Video, lblUserName.Text);
 }