Exemple #1
0
        /// <summary>
        /// Callback when the download progress
        /// </summary>
        private async void DownloadComplete(object sender, EventArgs e)
        {
            dynamic u            = (ModManager.OnDownloadCompleteArgs)e;
            bool    Success      = false;
            string  ErrorMessage = null;

            if (u != null)
            {
                Success      = u.Success;
                ErrorMessage = u.ErrorMessage;
            }
            else
            {
                return;
            }

            if (!Success)
            {
                await d.PromptAsync(Helpers._("Error.DownloadingTitle"), ErrorMessage);
            }
            else
            {
                InstalledModsTab.Focus();
            }
            DownloadUrlTextbox.Text = "";
            ValidateUrlInput();
            await d.CloseProgressDialog();
        }
Exemple #2
0
        private void FindAndInstallMod()
        {
            System.Windows.Forms.OpenFileDialog fd = new System.Windows.Forms.OpenFileDialog
            {
                // Set filter options and filter index.
                Filter      = Helpers._("FileDialog.Filter") + " (.zip)|*.zip",
                FilterIndex = 1,
                Multiselect = true
            };

            // Process input if the user clicked OK.
            if (fd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Mods.AddLocalMod(fd.FileName);
                InstalledModsTab.Focus();
            }
        }