コード例 #1
0
        private void UpdateConferenceInProgress()
        {
            // We can update this compoent only if we are in the form thread
            if (gbConferenceInProgress.InvokeRequired)
            {
                VoidDelegate d = new VoidDelegate(UpdateConferenceInProgress);
                this.Invoke(d, new object[] {  });
            }
            else
            {
                log.LogDebug("[UpdateConferenceInProgress] - IN");

                if (conferenceInProgress != null)
                {
                    if (conferenceInProgress.Active)
                    {
                        gbConferenceInProgress.Enabled = true;

                        Bubble bubble = rainbowBubbles.GetBubbleByConferenceIdFromCache(conferenceInProgress.Id);

                        if (bubble == null)
                        {
                            AddStateLine("Strange ! We don't have a bubble related to this conference ... This should never occurs ...");
                        }

                        // Is Personal Conference ?
                        Bubble personaleConferenceBubble = rainbowBubbles.PersonalConferenceGetBubbleFromCache();
                        if ((bubble != null) && (personaleConferenceBubble != null) &&
                            (bubble.Id == personaleConferenceBubble.Id))
                        {
                            cbIsPersonalConference.Checked = true;
                        }
                        else
                        {
                            cbIsPersonalConference.Checked = false;
                        }


                        // Bubble Id / Name / Owner
                        if (bubble != null)
                        {
                            tbBubbleId.Text   = bubble.Id;
                            tbBubbleName.Text = bubble.Name;

                            Contact owner = rainbowContacts.GetContactFromContactId(bubble.Creator);
                            if (owner != null)
                            {
                                tbBubbleOwner.Text = owner.DisplayName;
                            }
                            else
                            {
                                tbBubbleOwner.Text = "";
                            }
                        }
                        else
                        {
                            tbBubbleId.Text    = "";
                            tbBubbleName.Text  = "";
                            tbBubbleOwner.Text = "";
                        }

                        // Talkers
                        if ((conferenceInProgress.Talkers != null) &&
                            (conferenceInProgress.Talkers.Count > 0))
                        {
                            tbConferenceTalkers.Text = String.Join(",", conferenceInProgress.Talkers.ToArray());
                        }
                        else
                        {
                            tbConferenceTalkers.Text = "";
                        }

                        // Conference - global mute
                        if (conferenceInProgress.Muted)
                        {
                            btnConferenceMute.Text = "Unmute";
                        }
                        else
                        {
                            btnConferenceMute.Text = "Mute";
                        }

                        if (cbIsPersonalConference.Checked)
                        {
                            btnConferenceLock.Enabled = true;
                            /// Conference - global lock
                            if (conferenceInProgress.Locked)
                            {
                                btnConferenceLock.Text = "Unlock";
                            }
                            else
                            {
                                btnConferenceLock.Text = "Lock";
                            }
                        }
                        else
                        {
                            btnConferenceLock.Enabled = false;
                        }

                        // Update participants
                        UpdateConferenceParticipants(conferenceInProgress.Participants);

                        // Update publishers
                        UpdateConferencePublishers(conferenceInProgress.Publishers);
                    }
                    else
                    {
                        gbConferenceInProgress.Enabled = false;
                    }
                }
                else
                {
                    gbConferenceInProgress.Enabled = false;
                }


                if (!gbConferenceInProgress.Enabled)
                {
                    // Reset form to default values
                    cbIsPersonalConference.Checked = false;
                    tbBubbleId.Text    = "";
                    tbBubbleName.Text  = "";
                    tbBubbleOwner.Text = "";

                    tbConferenceTalkers.Text = "";

                    btnConferenceMute.Text = "Mute";
                    btnConferenceLock.Text = "Lock";

                    // Reset participants
                    UpdateConferenceParticipants(null);

                    // Reset publishers
                    UpdateConferencePublishers(null);
                }

                log.LogDebug("[UpdateConferenceInProgress] - OUT");
            }
        }
コード例 #2
0
        private void UpdateConferenceInProgress()
        {
            InvokeOnMainThread(() =>
            {
                log.Debug("[UpdateConferenceInProgress] - IN");

                if (conferenceInProgress != null)
                {
                    if (conferenceInProgress.Active)
                    {
                        box_inProgress.Hidden = false;

                        Bubble bubble = rainbowBubbles.GetBubbleByConferenceIdFromCache(conferenceInProgress.Id);

                        if (bubble == null)
                        {
                            AddStateLine("Strange ! We don't have a bubble related to this conference ... This should never occur ...");
                        }

                        // Is it a Personal Conference ?
                        Bubble personaleConferenceBubble = rainbowBubbles.PersonalConferenceGetBubbleFromCache();
                        if ((bubble != null) && (personaleConferenceBubble != null) &&
                            (bubble.Id == personaleConferenceBubble.Id))
                        {
                            cbIsPersonalConference.State = NSCellStateValue.On;
                        }
                        else
                        {
                            cbIsPersonalConference.State = NSCellStateValue.Off;
                        }


                        // Bubble Id / Name / Owner
                        if (bubble != null)
                        {
                            txtBubbleId.StringValue   = bubble.Id;
                            txtBubbleName.StringValue = bubble.Name;

                            Contact owner = rainbowContacts.GetContactFromContactId(bubble.Creator);
                            if (owner != null)
                            {
                                txtBubbleOwner.StringValue = owner.DisplayName;
                            }
                            else
                            {
                                txtBubbleOwner.StringValue = "";
                            }
                        }
                        else
                        {
                            txtBubbleId.StringValue    = "";
                            txtBubbleName.StringValue  = "";
                            txtBubbleOwner.StringValue = "";
                        }

                        // Talkers
                        if ((conferenceInProgress.Talkers != null) &&
                            (conferenceInProgress.Talkers.Count > 0))
                        {
                            txtConferenceTalkers.StringValue = String.Join(",", conferenceInProgress.Talkers.ToArray());
                        }
                        else
                        {
                            txtConferenceTalkers.StringValue = "";
                        }

                        // Conference - global mute
                        if (conferenceInProgress.Muted)
                        {
                            btnConferenceMute.StringValue = "Unmute";
                        }
                        else
                        {
                            btnConferenceMute.StringValue = "Mute";
                        }

                        if (cbIsPersonalConference.State == NSCellStateValue.On)
                        {
                            btnConferenceLock.Enabled = true;
                            /// Conference - global lock
                            if (conferenceInProgress.Locked)
                            {
                                btnConferenceLock.StringValue = "Unlock";
                            }
                            else
                            {
                                btnConferenceLock.StringValue = "Lock";
                            }
                        }
                        else
                        {
                            btnConferenceLock.Enabled = false;
                        }

                        // Update participants
                        UpdateConferenceParticipants(conferenceInProgress.Participants);

                        // Update publishers
                        UpdateConferencePublishers(conferenceInProgress.Publishers);
                    }
                    else
                    {
                        box_inProgress.Hidden = true;
                    }
                }
                else
                {
                    box_inProgress.Hidden = true;
                }


                if (box_inProgress.Hidden)
                {
                    // Reset form to default values
                    cbIsPersonalConference.State = NSCellStateValue.Off;
                    txtBubbleId.StringValue      = "";
                    txtBubbleName.StringValue    = "";
                    txtBubbleOwner.StringValue   = "";

                    txtConferenceTalkers.StringValue = "";

                    btnConferenceMute.StringValue = "Mute";
                    btnConferenceLock.StringValue = "Lock";

                    // Reset participants
                    UpdateConferenceParticipants(null);

                    // Reset publishers
                    UpdateConferencePublishers(null);
                }

                log.Debug("[UpdateConferenceInProgress] - OUT");
            });
        }