Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        public void AddMessage(string channel, string message)
        {
            TabInfo tabInfo = AddChannel(channel);

            tabInfo.AppendText(message);
        }