Example #1
0
        public MainPage()
        {
            InitializeComponent();
            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                TitleBlock.Visibility = Visibility.Collapsed;
            }
            Current = this;
            Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += MainPage_BackRequested;
            MainFrame.Navigate(typeof(NowWeatherPage), this);
            license = new License.License();
            var t = ThreadPool.RunAsync(async(w) =>
            {
                var c = Convert.ToUInt64(RoamingSettingsHelper.ReadSettingsValue("MeetDataSourceOnce"));
#if BETA
                if (true)
                {
                    RoamingSettingsHelper.WriteSettingsValue("MeetDataSourceOnce", SystemInfoHelper.GetPackageVersionNum());
                    await Task.Delay(1000);
                    await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, new Windows.UI.Core.DispatchedHandler(() =>
                    {
                        VersionText.Text           = SystemInfoHelper.GetPackageVer();
                        UpdateTitle.Text           = "BETA Version Note";
                        UpdateDetailText.Text      = "You are in BETA version NOW, all the features are unlocked and you should be clear what you are doing. You can contact with developers to quit BETA version. This BETA version is unstable and you MUST be aware of all the consequence that may arise.";
                        UpdateDetailText.FontSize  = 18;
                        UpdateLogButton.Visibility = Visibility.Collapsed;
                        ShowUpdateDetail();
                    }));
                }
#else
                if (c < SystemInfoHelper.GetPackageVersionNum())

                //if (true)
                {
                    RoamingSettingsHelper.WriteSettingsValue("MeetDataSourceOnce", SystemInfoHelper.GetPackageVersionNum());
                    await Task.Delay(1000);
                    await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, new Windows.UI.Core.DispatchedHandler(() =>
                    {
                        VersionText.Text = SystemInfoHelper.GetPackageVer();
                        ShowUpdateDetail();
                    }));
                }
#endif
                else
                {
                    HideUpdateButton_Click(null, null);
                }
            });
        }
Example #2
0
        public MainPageViewModel()
        {
            Current = this;
            player  = PlaybackEngine.PlaybackEngine.Current;
            if (Settings.Current.LastUpdateBuild < SystemInfoHelper.GetPackageVersionNum())
            {
                var i = new UpdateInfo();
#pragma warning disable CS4014 // 由于此调用不会等待,因此在调用完成前将继续执行当前方法
                i.ShowAsync();
#pragma warning restore CS4014 // 由于此调用不会等待,因此在调用完成前将继续执行当前方法
                Settings.Current.LastUpdateBuild = SystemInfoHelper.GetPackageVersionNum();
                Settings.Current.Save();
            }
            Task.Run(() =>
            {
                AttachVisualizerSource();
            });
            Task.Run(() =>
            {
                player.DownloadProgressChanged       += Player_DownloadProgressChanged;
                player.ItemsChanged                  += Player_StatusChanged;
                player.PlaybackStatusChanged         += Player_PlaybackStatusChanged;
                player.PositionUpdated               += Player_PositionUpdated;
                Downloader.Current.ProgressChanged   += Current_ProgressChanged;
                Downloader.Current.ProgressCancelled += Current_ProgressChanged;
                Downloader.Current.ItemCompleted     += Current_ProgressChanged;
                FileReader.ProgressUpdated           += Reader_ProgressUpdated;
                FileReader.Completed                 += Reader_Completed;
            });
            Task.Run(async() =>
            {
                await ReloadExtensions();
            });
            Task.Run(async() =>
            {
                await FindFileChanges();
            });
        }
Example #3
0
 public MainPageViewModel()
 {
     player  = Player.Current;
     Current = this;
     player.DownloadProgressChanged += Player_DownloadProgressChanged;
     player.StatusChanged           += Player_StatusChanged;
     player.PositionUpdated         += Player_PositionUpdated;
     var t = ThreadPool.RunAsync(async x =>
     {
         if (Settings.Current.LastUpdateBuild < SystemInfoHelper.GetPackageVersionNum())
         {
             var k = CoreApplication.MainView.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, async() =>
             {
                 UpdateInfo i = new UpdateInfo();
                 await i.ShowAsync();
                 Settings.Current.LastUpdateBuild = SystemInfoHelper.GetPackageVersionNum();
                 Settings.Current.Save();
             });
         }
         await ReloadExtensions();
         await FindFileChanges();
     });
 }
Example #4
0
        public MainPageViewModel()
        {
            Current = this;
            player  = PlaybackEngine.PlaybackEngine.Current;
            if (Settings.Current.LastUpdateBuild < SystemInfoHelper.GetPackageVersionNum())
            {
                if (Consts.UpdateNote == null)
                {
                    Settings.Current.LastUpdateBuild = SystemInfoHelper.GetPackageVersionNum();
                    Settings.Current.Save();
                }
                else
                {
                    var i = new UpdateInfo();
#pragma warning disable CS4014 // 由于此调用不会等待,因此在调用完成前将继续执行当前方法
                    i.ShowAsync();
#pragma warning restore CS4014 // 由于此调用不会等待,因此在调用完成前将继续执行当前方法
                    Settings.Current.LastUpdateBuild = SystemInfoHelper.GetPackageVersionNum();
                    Settings.Current.Save();
                }
            }
            Task.Run(() =>
            {
                AttachVisualizerSource();
            });
            Task.Run(() =>
            {
                player.DownloadProgressChanged       += Player_DownloadProgressChanged;
                player.ItemsChanged                  += Player_StatusChanged;
                player.PlaybackStatusChanged         += Player_PlaybackStatusChanged;
                player.PositionUpdated               += Player_PositionUpdated;
                Downloader.Current.ProgressChanged   += Current_ProgressChanged;
                Downloader.Current.ProgressCancelled += Current_ProgressChanged;
                Downloader.Current.ItemCompleted     += Current_ProgressChanged;
                FileReader.ProgressUpdated           += Reader_ProgressUpdated;
                FileReader.Completed                 += Reader_Completed;
            });
            Task.Run(async() =>
            {
                await ReloadExtensionsAsync();
            });
            Task.Run(async() =>
            {
                await FindFileChangesAsync();
            });
            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.Shell.AdaptiveCardBuilder"))
            {
                Task.Run(async() =>
                {
                    await CoreApplication.MainView.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, async() =>
                    {
                        activity = UserActivityChannel.GetDefault();

                        var id = Guid.NewGuid().ToString();

                        act = await activity.GetOrCreateUserActivityAsync(id);

                        if (act.State == UserActivityState.Published)
                        {
                            await activity.DeleteActivityAsync(id);
                            act = await activity.GetOrCreateUserActivityAsync(id);
                        }
                    });
                });
            }
            if (JumpList.IsSupported())
            {
                Task.Run(async() =>
                {
                    var jumpList = await JumpListHelper.LoadJumpListAsync();
                    await jumpList.SaveAsync();
                });
            }
        }