Esempio n. 1
0
 internal static async Task ShowIfAppropriateAsync()
 {
     if (SystemInformation.IsFirstRun)
     {
         var dialog = new FirstRunDialog();
         await dialog.ShowAsync();
     }
 }
Esempio n. 2
0
 public async Task ShowIfAppropriateAsync()
 {
     if (SystemInformation.Instance.IsFirstRun && !shown)
     {
         shown = true;
         var dialog = new FirstRunDialog();
         await dialog.ShowAsync();
     }
 }
 internal static async void ShowIfAppropriate()
 {
     if (SystemInformation.IsFirstRun && !shown)
     {
         shown = true;
         var dialog = new FirstRunDialog();
         await dialog.ShowAsync();
     }
 }
Esempio n. 4
0
 internal static async Task ShowIfAppropriateAsync()
 {
     try {
         var x = App.localSettings.Values["firstRun"].Equals("notFirstRun");
     } catch (Exception) {
         App.localSettings.Values["firstRun"] = "notFirstRun";
         var dialog = new FirstRunDialog();
         await dialog.ShowAsync();
     }
 }
        internal static async Task ShowIfAppropriateAsync()
        {
            try {
                var x = App.localSettings.Values["newUser"].Equals("false");
            } catch (Exception) {
                var dialog = new FirstRunDialog();
                await dialog.ShowAsync();

                App.localSettings.Values["newUser"] = "******";
            }
        }
Esempio n. 6
0
 internal static async Task ShowIfAppropriateAsync()
 {
     await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
     {
         if (SystemInformation.Instance.IsFirstRun && !_shown)
         {
             _shown     = true;
             var dialog = new FirstRunDialog();
             await dialog.ShowAsync();
         }
     });
 }
        internal static async Task ShowIfAppropriateAsync()
        {
            bool hasShownFirstRun = false;

            hasShownFirstRun = await Windows.Storage.ApplicationData.Current.LocalSettings.ReadAsync <bool>(nameof(hasShownFirstRun));

            if (!hasShownFirstRun)
            {
                await Windows.Storage.ApplicationData.Current.LocalSettings.SaveAsync(nameof(hasShownFirstRun), true);

                var dialog = new FirstRunDialog();
                await dialog.ShowAsync();
            }
        }
 public async Task RunIfAppropriateAsync()
 {
     await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
         CoreDispatcherPriority.Normal, async() =>
     {
         if (SystemInformation.IsFirstRun && !shown)
         {
             shown      = true;
             var dialog = new FirstRunDialog();
             BookmarkDataService.AddBookmarks();
             await dialog.ShowAsync();
         }
     });
 }
Esempio n. 9
0
        internal static async Task ShowIfAppropriateAsync()
        {
            var complete = new TaskCompletionSource <object>();
            await App.Shell.Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal, async() =>
            {
                if (SystemInformation.IsFirstRun && !shown)
                {
                    shown      = true;
                    var dialog = new FirstRunDialog();
                    await dialog.ShowAsync();
                }
                complete.SetResult(null);
            });

            await complete.Task;
        }
Esempio n. 10
0
        private void runSetup()
        {
            try
            {
                using (IUnitOfWork uow = UnitOfWorkFactory.CreateUnitOfWork())
                {
                    var setupWizardSetting = uow.SettingsRepository.GetSettingWithDefault(GinAppSettingKeys.SETUP_WIZARD_COMPLETE, "");

                    if (string.IsNullOrEmpty(setupWizardSetting))
                    {
                        //wizard hasn't been completed so let's run it
                        Logging.Logger.Log("INFO", "Launching setup form");
                        var setupForm = new FirstRunDialog();
                        focusApplication();
                        if (setupForm.ShowDialog() == DialogResult.OK)
                        {
                            Show();
                            this.WindowState = FormWindowState.Maximized;
                            SetForegroundWindow(this.Handle);
                        }
                        else
                        {
                            Application.Exit();
                        }
                    }
                    else
                    {
                        Show();
                        this.WindowState = FormWindowState.Maximized;
                        SetForegroundWindow(this.Handle);
                    }
                }
            }
            catch (Exception exc)
            {
                Logging.Logger.Log(exc);
                MessageBox.Show("An error occured in setup wizard");
                Application.Exit();
            }
        }
Esempio n. 11
0
        public async Task ShowFirstRunDialog()
        {
            var dialog = new FirstRunDialog();

            await ShowDialog(dialog);
        }
Esempio n. 12
0
 private async void Welcome_Click(object sender, RoutedEventArgs e)
 {
     var dialog = new FirstRunDialog();
     await dialog.ShowAsync();
 }