private static void OnThemeDialogClosed(object sender, EventArgs e)
        {
            themeDialog = null;
            isReady     = true;

            AppContext.RunInBackground();
        }
        public void DownloadImages()
        {
            if (!UwpDesktop.IsRunningAsUwp())
            {
                string imagesZipUri = JsonConfig.imageSettings.imagesZipUri;

                if (imagesZipUri == null)
                {
                    MessageBox.Show("Images folder not found. The program will quit now.", "Error",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    Environment.Exit(0);
                }

                downloadDialog             = new ProgressDialog();
                downloadDialog.FormClosed += OnDownloadDialogClosed;
                downloadDialog.Show();

                using (WebClient client = new WebClient())
                {
                    client.DownloadProgressChanged += downloadDialog.OnDownloadProgressChanged;
                    client.DownloadFileCompleted   += downloadDialog.OnDownloadFileCompleted;
                    client.DownloadFileAsync(new Uri(imagesZipUri), "images.zip");
                }
            }
            else
            {
                ThemeDialog dialog = new ThemeDialog();
                dialog.FormClosed += OnDownloadDialogClosed;
                dialog.Show();
            }
        }
 private static void OnThemeDialogClosed(object sender, FormClosedEventArgs e)
 {
     if (e.CloseReason == CloseReason.UserClosing)
     {
         themeDialog = null;
         LaunchSequence.NextStep(true);
     }
 }
 public static void SelectTheme()
 {
     if (themeDialog == null)
     {
         themeDialog             = new ThemeDialog();
         themeDialog.FormClosed += OnThemeDialogClosed;
         themeDialog.Show();
     }
     else
     {
         themeDialog.Activate();
     }
 }
示例#5
0
        public static void SelectTheme()
        {
            if (themeDialog == null)
            {
                themeDialog             = new ThemeDialog();
                themeDialog.FormClosed += OnThemeDialogClosed;
                themeDialog.Show();
            }

            themeDialog.BringToFront();

            if (importPaths.Count > 0)
            {
                List <string> tempImportPaths = new List <string>(importPaths.ToArray());
                importPaths.Clear();
                themeDialog.ImportThemes(tempImportPaths);
            }
        }
示例#6
0
 private static void OnThemeDialogClosed(object sender, EventArgs e)
 {
     themeDialog = null;
     LaunchSequence.NextStep(true);
 }