private bool isSelectedRepoModified(NPanday.Model.Settings.Repository selectedRepo) { if (selectedRepo == null) { return(false); } if (selectedRepo.snapshots == null || selectedRepo.releases == null || checkBoxSnapshot.Checked != selectedRepo.snapshots.enabled || checkBoxRelease.Checked != selectedRepo.releases.enabled) { return(true); } // check if URL is already in NPanday.id profile NPanday.Model.Settings.Profile defaultProfile = getDefaultProfile(); if (defaultProfile != null) { foreach (NPanday.Model.Settings.Repository repo in defaultProfile.repositories) { if (repo.url == RepoCombo.Text) { return(false); } } } return(true); }
private NPanday.Model.Settings.Repository getRepositoryFromDefaultProfile() { NPanday.Model.Settings.Profile defaultProfile = getDefaultProfile(); if (defaultProfile != null && defaultProfile.repositories != null && defaultProfile.repositories.Length > 0) { return(defaultProfile.repositories[0]); } return(null); }
private NPanday.Model.Settings.Repository getRepository(string url) { if (string.IsNullOrEmpty(url)) { return(null); } // extract from NPanday repositories first NPanday.Model.Settings.Repository repo; NPanday.Model.Settings.Profile defaultProfile = getDefaultProfile(); if (defaultProfile != null) { repo = SettingsUtil.GetRepositoryFromProfile(defaultProfile, url); if (repo != null) { return(repo); } } // extract from NON-NPanday repositories return(SettingsUtil.GetRepositoryByUrl(settings, url)); }