Ejemplo n.º 1
0
        void RefreshGroups()
        {
            if (InvokeRequired)
            {
                if (IsHandleCreated)
                {
                    BeginInvoke(new MethodInvoker(() => RefreshGroups()));
                }
                return;
            }

            cbSource.Items.Clear();

            bool foundActive = false;

            foreach (var tab in TC.Tabs)
            {
                RelaySourceType sourcetype = RelaySourceType.Unknown;
                RelaySource     newSource;

                if (tab.Value.Control is GroupIMTabWindow)
                {
                    sourcetype = RelaySourceType.Group;
                }
                else if (tab.Value.Control is ConferenceIMTabWindow)
                {
                    sourcetype = RelaySourceType.Conference;
                }
                else if (tab.Value.Control is IMTabWindow)
                {
                    sourcetype = RelaySourceType.IM;
                }
                else if (tab.Value.Control is ChatConsole)
                {
                    sourcetype = RelaySourceType.Chat;
                }
                else
                {
                    continue;
                }

                UUID sessionId = UUID.Zero;
                UUID.TryParse(tab.Key, out sessionId);

                if (sessionId == UUID.Zero && sourcetype != RelaySourceType.Chat)
                {
                    continue;
                }

                newSource = new RelaySource(sourcetype + ": " + tab.Value.Label, sourcetype, sessionId);

                if (sourcetype == RelaySourceType.IM)
                {
                    newSource.SessionId = (tab.Value.Control as IMTabWindow).TargetId;
                }

                if (newSource == currentSource)
                {
                    foundActive = true;
                }

                cbSource.Items.Add(newSource);
            }

            if (!foundActive)
            {
                currentSource = null;
                cbSource.Text = "None";
            }
        }
Ejemplo n.º 2
0
 public RelaySource(string name, RelaySourceType sourcetype, UUID sessionId)
 {
     Name       = name;
     SourceType = sourcetype;
     SessionId  = sessionId;
 }
Ejemplo n.º 3
0
 public RelaySource(string name, RelaySourceType sourcetype, UUID sessionId)
 {
     Name = name;
     SourceType = sourcetype;
     SessionId = sessionId;
 }