Beispiel #1
0
 private void SwitchProfile(RepoProfileViewModel profile)
 {
     _activeProfile = profile;
     ActivateControls();
     FillControls();
     UpdateProfilesMenuStrip();
     ListMods();
 }
Beispiel #2
0
        private void renameProfileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (var renameProfileForm = new RenameProfileForm(_settings, _activeProfile.Name))
            {
                renameProfileForm.ShowDialog(this);
                if (renameProfileForm.DialogResult == DialogResult.OK)
                {
                    ReadoutAllValues();
                    var renamedProfile = _profileManager.RenameProfile(_activeProfile.GetDataFromViewModel(), renameProfileForm.NewProfileName);
                    _activeProfile = renamedProfile.GetViewModelFromData();
                    _settingsManager.SaveSettings(_settings);

                    SwitchProfile(_activeProfile);
                }
            }
        }
Beispiel #3
0
        private bool IsRepoValid(RepoProfileViewModel profile)
        {
            var repoValid = ValidationHelper.IsRepoValid(profile.GetDataFromViewModel());

            if (!repoValid.HasFlag(RepoValidation.Valid))
            {
                var sb = new StringBuilder().AppendLine("The repository is not valid and/or missing information");

                if (repoValid.HasFlag(RepoValidation.RepoNameMissing))
                {
                    sb.AppendLine("* Repository name is missing");
                }

                if (repoValid.HasFlag(RepoValidation.TargetPathMissing))
                {
                    sb.AppendLine("* Target Path is missing");
                }

                if (repoValid.HasFlag(RepoValidation.ImagePathMissing))
                {
                    sb.AppendLine("* Image Path is missing");
                }

                if (repoValid.HasFlag(RepoValidation.IconPathMissing))
                {
                    sb.AppendLine("* Icon Path is missing");
                }

                if (repoValid.HasFlag(RepoValidation.ModsMissing))
                {
                    sb.AppendLine("* No mods selected");
                }

                MessageBox.Show(sb.ToString(), "Validation Error");
                return(false);
            }

            return(true);
        }