/// <summary> /// Tries to find the license identifier based on the URL. /// </summary> /// <remarks> /// The list of known URLs for different licenses, e.g. /// http://www.apache.org/licenses/LICENSE-2.0.html for Apache-2.0, /// can be set and extended via configuration. /// </remarks> public bool TryGetLicenseFromKnownUrl(Uri licenseUrl, out License license) { return(this.knownLicenseUrls.TryGetValue(Normalize(licenseUrl), out license)); }
/// <summary> /// Attached a license the package, returning the result. /// </summary> public LicensedPackage Attach(License license) { return(new LicensedPackage(Id, Version, OriginProject, license.Id, State, Messages)); }
public virtual bool IsMatch(string licenseId) { return(License.Equals(licenseId, StringComparison.InvariantCultureIgnoreCase)); }