Пример #1
0
 private void OnClosing(object sender, CancelEventArgs cancelEventArgs)
 {
     if (mainform != null)
     {
         mainform.changeEnabledStatusButtons();
     }
 }
Пример #2
0
        private void OnClosing(object sender, CancelEventArgs cancelEventArgs)
        {
            if (form.updateInProgress || form.archiveBegun)
            {
                string text = "видимо автор малок если это сообщение появилось. Проблема в update.OnClosing, с языком";
                if (form.Lang == "ru")
                {
                    text = "Вы уверены, что хотите закрыть это окно? Обновление в процессе";
                }
                if (form.Lang == "eng")
                {
                    text = "Update is currently in progress. Are you sure that you want to close the window? ";
                }
                switch (MessageBox.Show(text, "", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                {
                case DialogResult.Yes:
                    form.changeEnabledStatusButtons();
                    form.updateInProgress = false;
                    form.abortEtoGreh     = true;
                    form.updateForm       = null;
                    FileDownloader.getSetAbourt(true);
                    ZipArchiveExtensions.setUpdateCancel(mystate: true);
                    break;

                case DialogResult.No:
                    if (!downloadSR1HDMode)
                    {
                        form.updateRequired = true;
                    }
                    cancelEventArgs.Cancel = true;

                    break;
                }
            }
            else if (form != null)
            {
                form.changeEnabledStatusButtons();
                if (!updateRequired)
                {
                    form.play.Enabled = true;
                    form.play.Image   = Resources._2ContinueA;
                }
                form.updateForm = null;
            }
        }
Пример #3
0
        public update(string executePath, bool updateRequired, long totalBytes, mainform form, bool isModInstalled, string[] info, bool reinstall, bool downloadSR1HDMode)
        {
            //Присваивает все переменные

            bool sizeDiffers = false;

            string[] array = null;
            this.reinstall         = reinstall;
            this.downloadSR1HDMode = downloadSR1HDMode;
            this.info           = info;
            this.updateRequired = updateRequired;
            this.form           = form;
            this.executePath    = executePath;
            this.isModInstalled = isModInstalled;
            //Назначаемсвойства прогресс бара
            progressBar              = new CustomProgressBar();
            progressBar.Size         = new Size(775, 19);
            progressBar.Location     = new Point(121, 544);
            progressBar.DisplayStyle = ProgressBarDisplayText.CustomTex;
            base.Controls.Add(progressBar);
            InitializeComponent();

            //Добавляем некотрые кастомные события
            base.MouseDown += settings_MouseDown;
            base.MouseDown += pictureBox1_MouseDown;
            base.MouseDown += pictureBox1_MouseDown;
            base.Closing   += OnClosing;
            //Меняем визуальную и функциоальную составляющую кнопки на выключенную
            degenerateChoice.Enabled = false;
            degenerateChoice.Image   = SRHDLauncher.Properties.Resources._2OkD;
            //Проверка на наличие обновлений? Нужна ли?
            if (!downloadSR1HDMode)
            {
                string message = "";
                updateRequired = (reinstall || BoolConfirmation.checkIfUpdateIsRequired(executePath, "https://drive.google.com/file/d/1jDScpEkq-mybtv4SNtL-rjyE-9wM4Uos/view?usp=sharing", ref message, this, form, ref totalBytes, ref sizeDiffers, ref array));
            }
            //Выключение лишних кнопок в основной форме, дабы не было дубликатов
            form.changeEnabledStatusButtons();
            form.checkUpdates.Enabled = false;
            form.checkUpdates.Image   = SRHDLauncher.Properties.Resources._2SettingsD;

            //Установка соотвествующего языка в форме
            if (form.Lang == "ru")
            {
                setRu();
                progressBar.CustomText = "Инициализация...";
            }
            if (form.Lang == "eng")
            {
                setEng();
                progressBar.CustomText = "Initialising...";
            }
            Show();

            //Запуск механизма обновления
            updateAppPreparation();
        }
Пример #4
0
 public play(string executePath, mainform currentForm, bool turnOffLauncher)
 {
     this.turnOffLauncher = turnOffLauncher;
     this.executePath     = executePath;
     mainform             = currentForm;
     InitializeComponent();
     recomended.Checked = mainform.firstRun;
     custom.Checked     = !mainform.firstRun;
     if (mainform.Lang == "ru")
     {
         setRu();
     }
     if (mainform.Lang == "eng")
     {
         setEng();
     }
     mainform.changeEnabledStatusButtons();
     base.MouseDown += settings_MouseDown;
     base.MouseDown += pictureBox1_MouseDown;
     base.MouseDown += pictureBox1_MouseDown;
     base.Closing   += OnClosing;
 }