public void AddMessage(string channel, string message) { TabInfo tabInfo = AddChannel(channel); tabInfo.TextBox.AppendText($"{DateTime.Now:yyyy-MM-dd HH:mm:ss} - {message}\r\n"); }
public TabInfo AddChannel(string channel) { TabInfo tabInfo = Tabs.FirstOrDefault(x => x.Name.Equals(channel, StringComparison.InvariantCultureIgnoreCase)); if (tabInfo == null) { tabInfo = new TabInfo(channel); Tabs.Add(tabInfo); Tabs.Sort((x, y) => string.Compare(x.Name, y.Name, StringComparison.InvariantCultureIgnoreCase)); tc.SuspendLayout(); TabPage selected = tc.TabPages.Count > 0 ? tc.SelectedTab : null; tc.TabPages.Clear(); tc.TabPages.AddRange(Tabs.Select(x => x.Tab).ToArray()); if (selected != null) tc.SelectedTab = selected; tc.ResumeLayout(); } return tabInfo; }
public void AddMessage(string channel, string message) { TabInfo tabInfo = AddChannel(channel); tabInfo.AppendText(message); }