public bool Validate(IWebController context) { if (string.IsNullOrEmpty(context.ClientVersion)) { return(false); } return(Versions.Contains(context.ClientVersion)); }
private bool VersionMatch(IPackageSearchMetadata metadata) { if (Versions == null || Versions.All(string.IsNullOrWhiteSpace)) { return(true); } return(Versions.Contains(metadata.Identity.Version.ToString())); }
private void AddVersion(string version) { if (Versions == null) { Versions = new List <string>(); } if (!Versions.Contains(version)) { Versions.Add(version); } }
public void AddVersion(PackageItemDocument version) { if (!Versions.Contains(version)) { Versions.Add(version); if (string.Compare(LatestVersion, version.Version) < 0) { LatestVersion = version.Version; RaisePropertyChanged(nameof(LatestVersion)); } } }
public void DeleteVersion(Version removedVersion) { Debug.Assert(Versions.Contains(removedVersion)); versions.Remove(removedVersion); versionedProjects.Remove(removedVersion); Versions.InvokeCollectionChanged(); if (removedVersion.CreatedFrom != null) { Version previous = removedVersion.CreatedFrom; List <Version> branchedVersions = removedVersion.BranchedVersions.ToList(); foreach (Version branchedVersion in branchedVersions) { branchedVersion.CreatedFrom = previous; // there are some elements created in deleted removedVersion foreach (IVersionedElement createdInVersion in removedVersion.ElementsCreatedInVersion) { // I try to look up the element in all the derived removedVersion IVersionedElement derivedElement = this.LookupElementVersion(createdInVersion, branchedVersion); if (derivedElement != null) { // this derivedElement is now a first removedVersion SetAsFirstVersion(derivedElement, branchedVersion); } } } previous.BranchedVersions.Remove(removedVersion); } List <ComposedKey <IVersionedElement, Version> > toRemove = new List <ComposedKey <IVersionedElement, Version> >(); foreach (DictionaryEntry entry in versionTable) { ComposedKey <IVersionedElement, Version> key = (ComposedKey <IVersionedElement, Version>)entry.Key; IVersionedElement originalElement = key.First; Version derivedVersion = key.Second; IVersionedElement derivedElement = (IVersionedElement)entry.Value; if (derivedVersion == removedVersion) { toRemove.Add(key); } } foreach (var key in toRemove) { versionTable.Remove(key); } }
private void AddDefaultVersionIfNotContains() { if (DocsWebConsts.DefaultVersion == null) { return; } if (Versions.Contains(DocsWebConsts.DefaultVersion)) { return; } Versions.Insert(0, DocsWebConsts.DefaultVersion); }
/// <summary> /// Determines whether <paramref name="versionToCheck"/> is compatible with the combination of <see cref="Versions"/> and /// the <see cref="VersionMode"/> setting. /// </summary> /// <param name="versionToCheck"></param> /// <returns></returns> public bool IsSupported(float versionToCheck) { switch (VersionMode) { case RfwsVersionMode.AllVersions: return(true); case RfwsVersionMode.SpecificVersions: return(Versions.Contains(versionToCheck)); case RfwsVersionMode.SupportedVersionsAndLater: var supportedVersions = from supportedVersion in Versions where versionToCheck >= supportedVersion select supportedVersion; return(supportedVersions.Any()); default: return(false); } }
public bool Contains(ProjectionVersion item) { return(Versions.Contains(item)); }