Esempio n. 1
0
 internal void SetCancelingFMInstall()
 {
     ProgressCancelButton.Hide();
     ProgressBar.Style         = ProgressBarStyle.Marquee;
     ProgressMessageLabel.Text = LText.ProgressBox.CancelingInstall;
     ProgressBar.SetValueInstant(0);
     ProgressPercentLabel.Text = "";
 }
Esempio n. 2
0
        internal void ShowProgressWindow(ProgressTasks progressTask, bool suppressShow = false)
        {
            ProgressTask = progressTask;

            this.CenterHV(Owner !, clientSize: true);

            ProgressMessageLabel.Text = progressTask switch
            {
                ProgressTasks.ScanAllFMs => LText.ProgressBox.Scanning,
                ProgressTasks.InstallFM => LText.ProgressBox.InstallingFM,
                ProgressTasks.UninstallFM => LText.ProgressBox.UninstallingFM,
                ProgressTasks.ConvertFiles => LText.ProgressBox.ConvertingFiles,
                ProgressTasks.ImportFromDarkLoader => LText.ProgressBox.ImportingFromDarkLoader,
                ProgressTasks.ImportFromNDL => LText.ProgressBox.ImportingFromNewDarkLoader,
                ProgressTasks.ImportFromFMSel => LText.ProgressBox.ImportingFromFMSel,
                ProgressTasks.CacheFM => LText.ProgressBox.CachingReadmeFiles,
                ProgressTasks.DeleteFMArchive => LText.ProgressBox.DeletingFMArchive,
                _ => ""
            };

            CurrentThingLabel.Text =
                progressTask == ProgressTasks.ScanAllFMs ? LText.ProgressBox.CheckingInstalledFMs
                : "";

            ProgressPercentLabel.Text = "";

            if (progressTask == ProgressTasks.UninstallFM ||
                progressTask == ProgressTasks.ConvertFiles ||
                progressTask == ProgressTasks.ImportFromDarkLoader ||
                progressTask == ProgressTasks.ImportFromNDL ||
                progressTask == ProgressTasks.ImportFromFMSel ||
                progressTask == ProgressTasks.DeleteFMArchive)
            {
                ProgressBar.Style = ProgressBarStyle.Marquee;
                if (Owner?.IsHandleCreated == true)
                {
                    TaskBarProgress.SetState(Owner.Handle, TaskbarStates.Indeterminate);
                }
                ProgressCancelButton.Hide();
            }
            else
            {
                ProgressBar.Style            = ProgressBarStyle.Blocks;
                ProgressCancelButton.Visible = progressTask != ProgressTasks.CacheFM;
                ProgressBar.SetValueInstant(0);
            }

            if (!suppressShow)
            {
                ShowThis();
            }
        }