Пример #1
0
        /// <summary>
        /// Removes a disconnected <see cref="ITwitchAccount"/> from the account collection via
        /// the help of the UI dispatcher, and selects new account if current got removed.
        /// </summary>
        /// <param name="account"></param>
        private void RemoveChatAccount(ITwitchAccount account)
        {
            DispatcherHelper.CheckBeginInvokeOnUI(() =>
            {
                // Remove
                _chatAccounts.Remove(account);

                // Selected account got disconnected
                if (SelectedAccount == null && _chatAccounts.Count != 0)
                {
                    SelectedAccount = _chatAccounts[0];
                }
            });
        }
Пример #2
0
        /// <summary>
        /// Adds a authenticated <see cref="ITwitchAccount"/> to the account collection via the
        /// help of the UI dispatcher, and pre-selects the account if it's the first account.
        /// </summary>
        /// <param name="account"></param>
        private void AddChatAccount(ITwitchAccount account)
        {
            // Add account to collection
            DispatcherHelper.CheckBeginInvokeOnUI(() =>
            {
                // Add
                _chatAccounts.Add(account);

                // If only account, pre-select it
                if (_chatAccounts.Count == 1)
                {
                    SelectedAccount = account;
                }
            });
        }
Пример #3
0
 protected virtual void OnDisconnection(ITwitchAccount account, string reason)
 {
     Disconnected?.Invoke(this, new ChatConnectionDisconnectedEventArgs(account, reason));
 }
Пример #4
0
 protected virtual void OnAuthentication(ITwitchAccount account, bool authenticated)
 {
     Authenticated?.Invoke(this, new ChatConnectionAuthenticatedEventArgs(account, authenticated));
 }
Пример #5
0
 protected virtual void OnConnection(ITwitchAccount account)
 {
     Connected?.Invoke(this, new ChatConnectionConnectedEventArgs(account));
 }
Пример #6
0
 protected virtual void OnRawMessageReceived(ITwitchAccount account, TwitchChatMessage tcm)
 {
     RawMessageReceived?.Invoke(this, new ChatConnectionMessageReceivedEventArgs(account, tcm));
 }
Пример #7
0
 public ChatConnectionEventArgs(ITwitchAccount account) : base()
 {
     Account = account;
 }
Пример #8
0
 public ChatConnectionChannelJoinedEventArgs(ITwitchAccount account, string channel) : base(account)
 {
     Channel = channel;
 }
Пример #9
0
 public ChatConnectionDisconnectedEventArgs(ITwitchAccount account, string reason) : base(account)
 {
     Reason = reason;
 }
Пример #10
0
 public ChatConnectionAuthenticatedEventArgs(ITwitchAccount account, bool authenticated) : base(account)
 {
     IsAuthenticated = authenticated;
 }
Пример #11
0
 public ChatConnectionConnectedEventArgs(ITwitchAccount account) : base(account)
 {
 }
Пример #12
0
 public ChatConnectionMessageReceivedEventArgs(ITwitchAccount account, TwitchChatMessage chatmessage) : base(account)
 {
     ChatMessage = chatmessage;
 }