- ////タイマー初期化
- if (ResetTimers.Timeline || homeCounter <= 0 && SettingManager.Common.TimelinePeriod > 0)
- {
- Interlocked.Exchange(ref homeCounter, SettingManager.Common.TimelinePeriod);
- if (!tw.IsUserstreamDataReceived && !ResetTimers.Timeline)
- refreshTasks.Add(this.RefreshTabAsync<HomeTabModel>());
- ResetTimers.Timeline = false;
- }
- if (ResetTimers.Reply || mentionCounter <= 0 && SettingManager.Common.ReplyPeriod > 0)
- {
- Interlocked.Exchange(ref mentionCounter, SettingManager.Common.ReplyPeriod);
- if (!tw.IsUserstreamDataReceived && !ResetTimers.Reply)
- refreshTasks.Add(this.RefreshTabAsync<MentionsTabModel>());
- ResetTimers.Reply = false;
- }
- if (ResetTimers.DirectMessage || dmCounter <= 0 && SettingManager.Common.DMPeriod > 0)
- {
- Interlocked.Exchange(ref dmCounter, SettingManager.Common.DMPeriod);
- if (!tw.IsUserstreamDataReceived && !ResetTimers.DirectMessage)
- refreshTasks.Add(this.RefreshTabAsync<DirectMessagesTabModel>());
- ResetTimers.DirectMessage = false;
- }
- if (ResetTimers.PublicSearch || pubSearchCounter <= 0 && SettingManager.Common.PubSearchPeriod > 0)
- {
- Interlocked.Exchange(ref pubSearchCounter, SettingManager.Common.PubSearchPeriod);
- if (!ResetTimers.PublicSearch)
- refreshTasks.Add(this.RefreshTabAsync<PublicSearchTabModel>());
- ResetTimers.PublicSearch = false;
- }
- if (ResetTimers.UserTimeline || userTimelineCounter <= 0 && SettingManager.Common.UserTimelinePeriod > 0)
- {
- Interlocked.Exchange(ref userTimelineCounter, SettingManager.Common.UserTimelinePeriod);
- if (!ResetTimers.UserTimeline)
- refreshTasks.Add(this.RefreshTabAsync<UserTimelineTabModel>());
- ResetTimers.UserTimeline = false;
- }
- if (ResetTimers.Lists || listsCounter <= 0 && SettingManager.Common.ListsPeriod > 0)
- {
- Interlocked.Exchange(ref listsCounter, SettingManager.Common.ListsPeriod);
- if (!ResetTimers.Lists)
- refreshTasks.Add(this.RefreshTabAsync<ListTimelineTabModel>());
- ResetTimers.Lists = false;
- }
- if (ResetTimers.UserStream || usCounter <= 0 && SettingManager.Common.UserstreamPeriod > 0)
- {
- Interlocked.Exchange(ref usCounter, SettingManager.Common.UserstreamPeriod);
- if (this.tw.UserStreamActive)
- this.RefreshTimeline();
- ResetTimers.UserStream = false;
- }
- if (refreshFollowers > 6 * 3600)
- {
- Interlocked.Exchange(ref refreshFollowers, 0);
- refreshTasks.AddRange(new[]
- {
- this.doGetFollowersMenu(),
- this.RefreshNoRetweetIdsAsync(),
- this.RefreshTwitterConfigurationAsync(),
- });
- }
- if (osResumed)
- {
- Interlocked.Increment(ref ResumeWait);
- if (ResumeWait > 30)
- {
- osResumed = false;
- Interlocked.Exchange(ref ResumeWait, 0);
- refreshTasks.AddRange(new[]
- {
- this.RefreshTabAsync<HomeTabModel>(),
- this.RefreshTabAsync<MentionsTabModel>(),
- this.RefreshTabAsync<DirectMessagesTabModel>(),
- this.RefreshTabAsync<PublicSearchTabModel>(),
- this.RefreshTabAsync<UserTimelineTabModel>(),
- this.RefreshTabAsync<ListTimelineTabModel>(),
- this.doGetFollowersMenu(),
- this.RefreshTwitterConfigurationAsync(),
- });
- }
- }