示例#1
0
        private void Form2_Load(object sender, EventArgs e)
        {
            // Disables maximizing the window by setting the maximized size to the default size
            MaximizedBounds = Bounds;

            string installedModBotVersionString;

            do
            {
                _installationState = ModBotInstallerManager.GetModBotInstallationState(UserPreferences.Current.GameInstallationDirectory, out installedModBotVersionString, out string errorMessage);

                if (_installationState == ModBotInstallationState.Failed)
                {
                    DialogResult dialogResult = MessageBox.Show(errorMessage, "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);

                    if (dialogResult == DialogResult.Cancel)
                    {
                        // End current process
                        Utils.EndCurrentProcess();
                        return;
                    }
                    // If the selected option is not Cancel, we should try again
                }
            }while (_installationState == ModBotInstallationState.Failed);

            refreshItemsBasedOnCurrentState();

            if (installedModBotVersionString != null) // Just to be safe
            {
                LocalVersionLabel.Text = "Local version: " + installedModBotVersionString;
            }
            else
            {
                LocalVersionLabel.Visible = false;
            }

            if (ServerData.HasData)
            {
                LatestVersionLabel.Text = "Latest version: " + ServerData.LatestModBotVersion;
            }
            else
            {
                LatestVersionLabel.Visible = false;
            }
        }
 public GetModBotInstallationOutputStateInfo(ModBotInstallationState state, string version, string errorMessage)
 {
     State         = state;
     ModBotVersion = version;
     ErrorMessage  = errorMessage;
 }
 public GetModBotInstallationOutputStateInfo(ModBotInstallationState state, string version) : this(state, version, null)
 {
 }
 public GetModBotInstallationOutputStateInfo(ModBotInstallationState state) : this(state, null, null)
 {
 }