Пример #1
0
 internal void SetCancelingFMInstall()
 {
     ProgressCancelButton.Hide();
     ProgressBar.Style         = ProgressBarStyle.Marquee;
     ProgressMessageLabel.Text = LText.ProgressBox.CancelingInstall;
     ProgressBar.SetValueInstant(0);
     ProgressPercentLabel.Text = "";
 }
Пример #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();
            }
        }
Пример #3
0
        internal void HideThis()
        {
            if (Owner?.IsHandleCreated == true)
            {
                TaskBarProgress.SetState(Owner.Handle, TaskbarStates.NoProgress);
            }

            Hide();

            ProgressMessageLabel.Text = "";
            CurrentThingLabel.Text    = "";
            ProgressPercentLabel.Text = "";
            ProgressBar.SetValueInstant(0);

            ProgressBar.Style = ProgressBarStyle.Blocks;
            ProgressCancelButton.Show();

            Enabled = false;
            Owner !.EnableEverything(true);
        }
Пример #4
0
 internal void Localize()
 {
     ProgressCancelButton.SetTextAutoSize(LText.Global.Cancel, ProgressCancelButton.Width);
     ProgressCancelButton.CenterH(this);
 }