private static void OnOffline(User user) { EventHandler<MKTwitchEventArgs> handler = OffLine; if (handler != null) { handler.Invoke(null, new MKTwitchEventArgs { User = user}); } }
private void FillInToast(User user) { toast.DisplayName = user.Name; toast.Game = user.Game; toast.Viewers = user.NumViewers; toast.StreamCreatedAt = user.StreamCreatedAt; toast.IsLive = user.IsStreaming; toast.Thumbnail = user.Thumbnail; toast.Link = user.Link; }
public static void TriggerOffline(User user) { OnOnline(user); }
private void FillInToast(User user) { toast.DisplayName = user.Name; toast.Game = user.Game; toast.Viewers = user.NumViewers; toast.StreamCreatedAt = user.StreamCreatedAt; toast.IsLive = user.IsStreaming; toast.Thumbnail = user.Thumbnail; toast.Link = user.Link; toast.Status = user.Status; toast.NumberLiveStreaming = MKTwitch.followedUsers.Count(i => i.IsStreaming); }
/// <summary> /// Invoked whenever the user UnFollows a streamer /// </summary> /// <param name="user"></param> private static void OnUnfollowed(User user) { EventHandler<MKTwitchEventArgs> handler = Unfollowed; handler?.Invoke(null, new MKTwitchEventArgs() { User = user }); }
/// <summary> /// Invoked when a streamer changes their Status /// </summary> /// <param name="user"></param> /// <param name="newStatus"></param> /// <param name="oldStatus"></param> private static void OnStatusChanged(User user, string newStatus, string oldStatus) { EventHandler<MKTwitchEventArgs> handler = StatusChanged; handler?.Invoke(null, new MKTwitchEventArgs() {User = user, NewStatus = newStatus, OldStatus = oldStatus }); }
/// <summary> /// Invoked when a streamer changes their Game /// </summary> /// <param name="user"></param> /// <param name="newGame"></param> private static void OnGameChanged(User user, string newGame, string oldGame) { EventHandler<MKTwitchEventArgs> handler = GameChanged; handler?.Invoke(null, new MKTwitchEventArgs() {User = user, NewGame = newGame, OldGame = oldGame}); }
/// <summary> /// Invoked when a streamer goes Offline (Stops Streaming) /// </summary> /// <param name="user"></param> /// <param name="displayToast"></param> private static void OnOffline(User user,bool displayToast=true) { EventHandler<MKTwitchEventArgs> handler = OffLine; handler?.Invoke(null, new MKTwitchEventArgs{ User = user, DisplayToast = displayToast}); }