// Caculate the version to select among _versions and select it protected void SelectVersion() { if (_versions.Count == 0) { // there's nothing to select return; } VersionForDisplay versionToSelect = null; if (SelectedAction == Resources.Action_Install) { versionToSelect = _versions .Where(v => v != null && v.Version.Equals(_searchResultPackage.Version)) .FirstOrDefault(); if (versionToSelect == null) { versionToSelect = _versions[0]; } } else { versionToSelect = _versions[0]; } if (versionToSelect != null) { SelectedVersion = versionToSelect; } }
// Caculate the version to select among _versions and select it protected void SelectVersion() { if (_versions.Count == 0) { // there's nothing to select return; } VersionForDisplay versionToSelect = null; if (SelectedAction == Resources.Action_Install) { versionToSelect = _versions .Where(v => v != null && v.Version.Equals(_searchResultPackage.Version)) .FirstOrDefault(); if (versionToSelect == null) { versionToSelect = _versions[0]; } } else { versionToSelect = _versions[0]; } if (versionToSelect != null) { SelectedVersion = versionToSelect; } }