private void DisplayReleaseNotes(string html)
        {
            string htmlFile = Path.GetTempFileName();

            File.WriteAllText(htmlFile, html);

            var dialog = new ReleaseNotesDialog {
                HtmlFile = new Uri($"file://{htmlFile}")
            };

            dialog.ShowReleaseNotesChanged +=
                (sender, args) => _generalOptions.ShowReleaseNotes = dialog.ShowReleaseNotes;
            dialog.Closed += (sender, args) => File.Delete(htmlFile);
            dialog.ShowDialog();
        }
Beispiel #2
0
        private void DisplayReleaseNotes(string html)
        {
            string htmlFileBase = Path.GetTempFileName();
            string htmlFile     = Path.ChangeExtension(htmlFileBase, "html");

            File.Delete(htmlFileBase);

            File.WriteAllText(htmlFile, html);

            using (var dialog = new ReleaseNotesDialog
            {
                HtmlFile = new Uri($"file://{htmlFile}")
            })
            {
                dialog.Closed += (sender, args) => File.Delete(htmlFile);
                dialog.ShowDialog();
            }
        }
Beispiel #3
0
        private async void Page_Loaded(object sender, RoutedEventArgs e)
        {
            if (ReleaseNotesManager.ShowReleaseNotes)
            {
                ReleaseNotesDialog dialog = new ReleaseNotesDialog();
                await dialog.ShowAsync();
            }

            bool synchronize = false;

            if (SettingsManager.Get <bool>(Setting.UseCloudSynchronization) && AccountStorage.Instance.HasSynchronizer)
            {
                AccountStorage.Instance.SynchronizationStarted   += SynchronizationStarted;
                AccountStorage.Instance.SynchronizationCompleted += SynchronizationCompleted;

                Synchronize.Visibility = Visibility.Visible;

                if (SettingsManager.Get <int>(Setting.WhenToSynchronize) == 0)
                {
                    synchronize = true;
                }
            }

            await LoadAccounts();

            PageGrid.Children.Remove(LoaderProgressBar);

            if (firstLoad && synchronize)
            {
                UpdateLocalFromRemote();
            }

            firstLoad = false;

            if (AccountStorage.Instance.IsSynchronizing)
            {
                Synchronize.StartAnimationAndDisable();
                Edit.IsEnabled       = false;
                ButtonUndo.IsEnabled = false;
            }
        }
Beispiel #4
0
        private void DisplayReleaseNotes(string html)
        {
            string htmlFileBase = Path.GetTempFileName();
            string htmlFile = Path.ChangeExtension(htmlFileBase, "html");
            File.Delete(htmlFileBase);

            File.WriteAllText(htmlFile, html);

            using (var dialog = new ReleaseNotesDialog
            {
                HtmlFile = new Uri($"file://{htmlFile}"),
                ShowReleaseNotesChecked = _generalOptions.ShowReleaseNotes
            })
            {
                dialog.AddExternalUri(Donations.Uri);
                dialog.ShowReleaseNotesChanged +=
                    (sender, args) => _generalOptions.ShowReleaseNotes = args.ShowReleaseNotes;
                dialog.Closed += (sender, args) => File.Delete(htmlFile);
                dialog.ShowDialog();
            }
        }
Beispiel #5
0
 public static async void ShowReleaseNotes()
 {
     var dialog = new ReleaseNotesDialog();
     await dialog.ShowAsync();
 }