Exemplo n.º 1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            path.Save();

            ConfigFile config = new ConfigFile();

            Burntime.Platform.IO.File file = file = FileSystem.GetFile(settings);
            config.Open(file);
            file.Close();

            if (cmbPresentation.SelectedIndex == 0)
            {
                config["system"].Set("windowmode", false);
            }
            else
            {
                config["system"].Set("windowmode", true);
                if (cmbPresentation.SelectedIndex == 2)
                {
                    config["system"].Set("resolution", new Vector2(960, 600));
                }
                else
                {
                    config["system"].Set("resolution", new Vector2(640, 400));
                }
            }

            FileSystem.RemoveFile(settings);
            file = FileSystem.CreateFile(settings);
            config.Save(file);
            file.Close();

            Close();
        }
Exemplo n.º 2
0
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            Burntime.Autoupdate.Updater updater = new Burntime.Autoupdate.Updater(debugMode ? "../" : "");
            lblVersion.Text = updater.LocalVersion;

            if (!updater.AlwaysCheck)
            {
                downloadUpdate.Text    = "check for new version";
                downloadUpdate.Visible = true;
            }
            else
            {
                downloadUpdate.Visible = false;
            }


            if (updater.AlwaysCheck && updater.CheckForUpdates())
            {
                if (updater.AlwaysAsk)
                {
                    if (updater.ShowDownloadQuestion())
                    {
                        // update
                        updater.InitiateUpdate();
                        //requestRestart = true;

                        Close();
                        return;
                    }
                }

                lblVersion.Text        = updater.LocalVersion;
                downloadUpdate.Text    = "update to " + updater.VersionAvailable;
                downloadUpdate.Visible = true;
            }

            if (!path.IsValid)
            {
                if (DialogResult.OK == MessageBox.Show(txt.Data[21] + "\n" + txt.Data[22], txt.Data[23], MessageBoxButtons.OKCancel, MessageBoxIcon.Information))
                {
                    do
                    {
                        if (DialogResult.OK != path.ShowSelector())
                        {
                            break;
                        }

                        btnSingle.Enabled = path.IsValid;
                        btnMulti.Enabled  = path.IsValid & enableMulti;
                        if (btnSingle.Enabled)
                        {
                            btnSingle.Focus();
                        }

                        if (!path.IsValid)
                        {
                            MessageBox.Show(txt.Data[24], txt.Data[23], MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                        else
                        {
                            path.Save();
                        }
                    } while (!path.IsValid);
                }
            }
        }