Пример #1
0
        /// <summary>
        /// 各リストとコンテキストメニューの更新
        /// </summary>
        public async Task RefreshNotifyIconAsync()
        {
            OnRefreshStarting();

            var tasks = new List <Task>();

            foreach (AbstractManager manager in EnableManagers)
            {
                //サイトごとにタスクを作り、配信一覧からお気に入りの更新まで済ませる
                tasks.Add(manager.RefreshLiveAsync().ContinueWith(task =>
                {
                    if (task.Result)
                    {
                        BalloonManager.AddRange(manager.CheckFavorite());
                    }
                }));
            }
            await Task.WhenAll(tasks);

            if (!balloonTimer.Enabled)
            {
                //通知スタック1つ目を即座に処理
                balloonTimer.Enabled = BalloonManager.ExcuteBalloonQueue(balloontime, SOUND_LOCAL_PATH) > 0;
            }

            RefreshMenuAndIcon();

            OnRefreshCompleted();
        }
Пример #2
0
        /// <summary>
        /// 1箇所だけ更新があったとき用
        /// </summary>
        public void RefreshNotifyIconLite(AbstractManager manager)
        {
            BalloonManager.AddRange(manager.CheckFavorite());

            if (!balloonTimer.Enabled)
            {
                //通知スタック1つ目を即座に処理
                balloonTimer.Enabled = BalloonManager.ExcuteBalloonQueue(balloontime, SOUND_LOCAL_PATH) > 0;
            }

            RefreshMenuAndIcon();
        }