Ejemplo n.º 1
0
 public void Merge(Surgery Surgery, bool IsInControl, bool IsMaster)
 {
     if (!IsInControl)
     {
         this.InControlPosition = Surgery.InControlPosition;
         this.UserInControl = Surgery.UserInControl;
     }
     if (!IsMaster)
     {
         this.Master = Surgery.Master;
         this.ConnectedClients = Surgery.ConnectedClients;
     }
 }
        private void disconnectClient(User client)
        {
            foreach (ToolStripItem item in ss_Connections.Items)
            {
                if (item.ToolTipText == client.MyIPAddress)
                {
                    ss_Connections.Items.Remove(item);
                    break;
                }
            }
            int indexOfName = lbl_Connections.Text.IndexOf(client.MyName);
            if (indexOfName > -1)
                lbl_Connections.Text = lbl_Connections.Text.Remove(indexOfName, client.MyName.Length);
            Surgery.ConnectedClients.Remove(client);

            if (Surgery.UserInControl.MyIPAddress == client.MyIPAddress)
                switchControl(true);

            if (Surgery.ConnectedClients.Count == 0)
            {
                VideoCapture.IsStreaming = false;
                Markup.IsListeningForMarkup = false;
                lbl_Connections.Text = "Connections: None";
            }
        }