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"; } }
public RelaySource(string name, RelaySourceType sourcetype, UUID sessionId) { Name = name; SourceType = sourcetype; SessionId = sessionId; }
public RelaySource(string name, RelaySourceType sourcetype, UUID sessionId) { Name = name; SourceType = sourcetype; SessionId = sessionId; }