/// <summary> /// Initializes a new instance of the <see cref="BrowserIdentification"/> class. /// </summary> /// <param name="name">Name.</param> /// <param name="version">Version.</param> /// <param name="platform">Platform.</param> public BrowserIdentification(string name, BrowserVersion version, string platform) { if (name == null) { throw new ArgumentNullException(nameof(name)); } if (version == null) { throw new ArgumentNullException(nameof(version)); } if (platform == null) { throw new ArgumentNullException(nameof(platform)); } Name = name; Version = version; Platform = platform; }
BrowserVersion CreateVersion(string versionString, string browserName, bool isPresumedVersion) { if (String.IsNullOrEmpty(versionString)) { return(EmptyBrowserVersion.Singleton); } BrowserVersion output = SemanticVersion.Parse(versionString, isPresumedVersion); if (output != null) { return(output); } output = DottedNumericVersion.Parse(versionString, isPresumedVersion); if (output != null) { return(output); } return(new UnrecognisedVersion(versionString, isPresumedVersion)); }
/// <summary> /// Determines whether the specified <see cref="BrowserVersion"/> is equal to the current <see cref="UnrecognisedVersion"/>. /// </summary> /// <param name="other">The <see cref="BrowserVersion"/> to compare with the current <see cref="UnrecognisedVersion"/>.</param> /// <returns><c>true</c> if the specified <see cref="BrowserVersion"/> is equal to the current /// <see cref="UnrecognisedVersion"/>; otherwise, <c>false</c>.</returns> public override bool Equals(BrowserVersion other) => Equals(other as UnrecognisedVersion);
/// <summary> /// Compares the current instance to another <see cref="BrowserVersion" /> instance, returning eiher /// minus one, zero or one. /// </summary> /// <param name="other">The browser version to compare with.</param> public override int CompareTo(BrowserVersion other) => CompareTo(other as UnrecognisedVersion);
/// <summary> /// Compares the current instance to another <see cref="BrowserVersion" /> instance, returning eiher /// minus one, zero or one. /// </summary> /// <param name="other">The browser version to compare with.</param> public override int CompareTo(BrowserVersion other) => CompareTo(other as SemanticVersion);
/// <summary> /// Determines whether the specified <see cref="BrowserVersion"/> is equal to the current <see cref="SemanticVersion"/>. /// </summary> /// <param name="other">The <see cref="BrowserVersion"/> to compare with the current <see cref="SemanticVersion"/>.</param> /// <returns><c>true</c> if the specified <see cref="BrowserVersion"/> is equal to the current /// <see cref="SemanticVersion"/>; otherwise, <c>false</c>.</returns> public override bool Equals(BrowserVersion other) => Equals(other as SemanticVersion);
/// <summary> /// Determines whether the specified <see cref="BrowserVersion"/> is equal to the current <see cref="EmptyBrowserVersion"/>. /// </summary> /// <param name="other">The <see cref="BrowserVersion"/> to compare with the current <see cref="EmptyBrowserVersion"/>.</param> /// <returns><c>true</c> if the specified <see cref="BrowserVersion"/> is equal to the current /// <see cref="EmptyBrowserVersion"/>; otherwise, <c>false</c>.</returns> public override bool Equals(BrowserVersion other) => Equals(other as EmptyBrowserVersion);
/// <summary> /// Compares the current instance to another <see cref="BrowserVersion" /> instance, returning eiher /// minus one, zero or one. /// </summary> /// <param name="other">The browser version to compare with.</param> public override int CompareTo(BrowserVersion other) => CompareTo(other as EmptyBrowserVersion);