/// <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]; } }); }
/// <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; } }); }
protected virtual void OnDisconnection(ITwitchAccount account, string reason) { Disconnected?.Invoke(this, new ChatConnectionDisconnectedEventArgs(account, reason)); }
protected virtual void OnAuthentication(ITwitchAccount account, bool authenticated) { Authenticated?.Invoke(this, new ChatConnectionAuthenticatedEventArgs(account, authenticated)); }
protected virtual void OnConnection(ITwitchAccount account) { Connected?.Invoke(this, new ChatConnectionConnectedEventArgs(account)); }
protected virtual void OnRawMessageReceived(ITwitchAccount account, TwitchChatMessage tcm) { RawMessageReceived?.Invoke(this, new ChatConnectionMessageReceivedEventArgs(account, tcm)); }
public ChatConnectionEventArgs(ITwitchAccount account) : base() { Account = account; }
public ChatConnectionChannelJoinedEventArgs(ITwitchAccount account, string channel) : base(account) { Channel = channel; }
public ChatConnectionDisconnectedEventArgs(ITwitchAccount account, string reason) : base(account) { Reason = reason; }
public ChatConnectionAuthenticatedEventArgs(ITwitchAccount account, bool authenticated) : base(account) { IsAuthenticated = authenticated; }
public ChatConnectionConnectedEventArgs(ITwitchAccount account) : base(account) { }
public ChatConnectionMessageReceivedEventArgs(ITwitchAccount account, TwitchChatMessage chatmessage) : base(account) { ChatMessage = chatmessage; }