void RepositionGame(string game, int position) { lock (gameslock) { RemoveGame(game); games.Insert(Clamp(position, 0, games.Count), new Game { Name = game }); if (games.Count == 1) { context.GetModule <TickerModule>().AddSource(this); } } }
/// <summary> /// Add notification and do other ui stuff. /// </summary> /// <param name="notification">notification.</param> private async Task addNotification(string notification, DateTime time) { NotificationList.Insert(0, new NotificationItem(notification, time)); if (!IsNotificationOpen) { UnreadNotificationCount++; } Notification = notification; await Task.Run(() => { System.Threading.Thread.Sleep(Properties.Settings.Default.HideNotificationDelayMsec); Notification = Properties.Resources.NotificationListPlaceholder; }); }