private Task UpdateTitle(string title)
        {
            SpecialEvent e = new SpecialEvent(title);

            UpdateTitleText?.Invoke(this, e);
            return(Task.CompletedTask);
        }
        private Task Client_Log(LogMessage msg)
        {
            SpecialEvent e = new SpecialEvent(msg.ToString());

            LogClient?.Invoke(this, e);
            return(Task.CompletedTask);
        }
        void Server_Log(object sender, SpecialEvent e)
        {
            BeginInvoke(new Action(
                            () =>
            {
                if (e.Text == _lastMessage)
                {
                    _messageCount++;

                    string[] lines          = logBox.Lines;
                    lines[lines.Length - 2] = $"{_messageTime} - {DateTime.Now} > {e.Text} x{_messageCount}";
                    logBox.Lines            = lines;
                }
                else
                {
                    logBox.Text  += $"{DateTime.Now} > {e.Text} \n";
                    _messageCount = 1;
                    _messageTime  = DateTime.Now;
                }
                _lastMessage = e.Text;
            }
                            ));
        }
        private void Log(string text)
        {
            SpecialEvent e = new SpecialEvent(text);

            OnRequestLogUpdated(e);
        }
 protected virtual void OnRequestLogUpdated(SpecialEvent e) => LogText?.Invoke(this, e);
 void UpdateTitle(object sender, SpecialEvent e)
 {
     BeginInvoke(new Action(
                     () => this.Text = e.Text
                     ));
 }