Example #1
0
        private async Task NotificationAsync(NotificationMessage str)
        {
    
            await SharedDispatcher.RunAsync(() =>
            {
                if (Setting.IsNotificationEnable)
                {
                    NotifyMessage = str;
                    if (Setting.IsToastNotification)
                    {
                        Messenger.Notify<bool>(true, "ToastNotification");
                    }
                    if (Setting.IsInternalNotification)
                    {
                        Messenger.Notify<bool>(true, "InternalNotification");
                    }
                }
            });

        }
Example #2
0
        public NeuroniaModel(CoreDispatcher dispatcher, ConsumerData consumerData)
        {
            SharedDispatcher.Dispatcher = dispatcher;
            twitterUIComponent          = new TwitterUIComponent();
            accountList              = new ObservableCollection <TwitterAccount>();
            TimelineListTab          = new ObservableCollection <TimelineTab>();
            NowTimelineList          = new ObservableCollection <TimelineBase>();
            SearchDetail             = new SearchDetail();
            Setting                  = new SettingData();
            TweetDetail              = new TweetDetail(new TimelineRow(Tweet.ZeroTweet, "", Setting, CallRowAction));
            DMDetail                 = new DirectMessageDetail();
            UserDetail               = new UserDetail();
            NotifyMessage            = new NotificationMessage();
            IsFirstNavigate          = true;
            this.consumerData        = consumerData;
            this.connectionStatusStr = "";
            Authorizer               = new TwitterAuthorizer();
            restTimerCounter         = 0;
            LicenseInfo              = CurrentApp.LicenseInformation;

            RestTimer          = new DispatcherTimer();
            RestTimer.Interval = TimeSpan.FromMinutes(1);
            RestTimer.Tick    += (s, e) => Task.Run(async() =>
            {
                await SharedDispatcher.RunAsync(() =>
                {
                    NowTime    = DateTime.Now;
                    NowTimeStr = NowTime.ToString("HH:mm");
                });

                if (restTimerCounter % 2 == 0)
                {
                    foreach (var tab in TimelineListTab)
                    {
                        foreach (var t in tab.TimelineList)
                        {
                            await t.RestUpdate();
                        }
                    }
                }
                if (restTimerCounter % 10 == 0)
                {
                    TwitterUIComponent.MentionSuggestSourceList.Clear();
                    TwitterUIComponent.HashSuggestSourceList.Clear();
                    foreach (var tab in TimelineListTab)
                    {
                        foreach (var t in tab.TimelineList)
                        {
                            foreach (var ac in (await t.GetTimelineAccountListAsync()))
                            {
                                TwitterUIComponent.MentionSuggestSourceList.Add(ac);
                            }
                            foreach (var ac in (await t.GetTimelineHashTagListAsync()))
                            {
                                TwitterUIComponent.HashSuggestSourceList.Add(ac);
                            }
                        }
                    }
                }
                restTimerCounter++;
                if (restTimerCounter > 100)
                {
                    restTimerCounter = 0;
                }
            });
            RestTimer.Start();

            timelineWidth = 320;
            IsFirstLaunch = true;
            if (LicenseInfo.ProductLicenses["ApplicationTheme"].IsActive)
            {
                IsPurchase = true;
            }
            else
            {
                IsPurchase = false;
            }
        }
Example #3
0
 public NeuroniaModel(CoreDispatcher dispatcher, ConsumerData consumerData)
 {
     SharedDispatcher.Dispatcher = dispatcher;
     twitterUIComponent = new TwitterUIComponent();
     accountList = new ObservableCollection<TwitterAccount>();
     TimelineListTab = new ObservableCollection<TimelineTab>();
     NowTimelineList = new ObservableCollection<TimelineBase>();
     SearchDetail = new SearchDetail();
     Setting = new SettingData();
     TweetDetail = new TweetDetail(new TimelineRow(Tweet.ZeroTweet,"",Setting,CallRowAction));
     DMDetail = new DirectMessageDetail();
     UserDetail = new UserDetail();
     NotifyMessage = new NotificationMessage();
     IsFirstNavigate = true;
     this.consumerData = consumerData;
     this.connectionStatusStr = "";
     Authorizer = new TwitterAuthorizer();
     restTimerCounter = 0;
     LicenseInfo = CurrentApp.LicenseInformation;
    
     RestTimer = new DispatcherTimer();
     RestTimer.Interval = TimeSpan.FromMinutes(1);
     RestTimer.Tick += (s, e) => Task.Run(async() =>
     {
         await SharedDispatcher.RunAsync(() =>
         {
             NowTime = DateTime.Now;
             NowTimeStr = NowTime.ToString("HH:mm");
         });
         
         if (restTimerCounter%2 == 0)
         {
             foreach (var tab in TimelineListTab)
             {
                 foreach (var t in tab.TimelineList)
                 {
                     await t.RestUpdate();
                 }
             }
         }
         if (restTimerCounter%10 == 0)
         {
             TwitterUIComponent.MentionSuggestSourceList.Clear();
             TwitterUIComponent.HashSuggestSourceList.Clear();
             foreach (var tab in TimelineListTab)
             {
                 foreach (var t in tab.TimelineList)
                 {
                     foreach (var ac in (await t.GetTimelineAccountListAsync()))
                     {
                         TwitterUIComponent.MentionSuggestSourceList.Add(ac);
                     }
                     foreach (var ac in (await t.GetTimelineHashTagListAsync()))
                     {
                         TwitterUIComponent.HashSuggestSourceList.Add(ac);
                     }
                 }
             }
         }
         restTimerCounter++;
         if (restTimerCounter > 100)
         {
             restTimerCounter = 0;
         }
         
     });
     RestTimer.Start();
     
     timelineWidth = 320;
     IsFirstLaunch = true;
     if (LicenseInfo.ProductLicenses["ApplicationTheme"].IsActive)
     {
         IsPurchase = true;
     }
     else
     {
         IsPurchase = false;
     }
     
 }