コード例 #1
0
 protected bool Equals(RelaySource other)
 {
     return(string.Equals(Name, other.Name) && SourceType == other.SourceType && SessionId.Equals(other.SessionId));
 }
コード例 #2
0
 private void cbSource_SelectionChangeCommitted(object sender, EventArgs e)
 {
     currentSource = cbSource.SelectedItem as RelaySource;
 }
コード例 #3
0
ファイル: RelayConsole.cs プロジェクト: Booser/radegast
        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";
            }
        }
コード例 #4
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";
            }
        }
コード例 #5
0
ファイル: RelayConsole.cs プロジェクト: Booser/radegast
 private void cbSource_SelectionChangeCommitted(object sender, EventArgs e)
 {
     currentSource = cbSource.SelectedItem as RelaySource;
 }