public DependencyCheckStatus(bool checkPassed, DependencyVersion version = null, string message = "", Exception innerException = null) { this.CheckPassed = checkPassed; this.Version = version; this.Message = message; this.InnerException = innerException; }
/// <summary> /// Initializes a new instance of the <see cref="DependencyCheckStatus" /> class. /// </summary> /// <param name="checkStatus">The dependency check status.</param> /// <param name="version">The version.</param> /// <param name="message">The message.</param> /// <param name="innerException">The inner exception.</param> public DependencyCheckStatus(NAMEStatusLevel checkStatus, DependencyVersion version = null, string message = "", Exception innerException = null) { #pragma warning disable CS0618 // Maintain backwards compatibility this.CheckPassed = checkStatus == NAMEStatusLevel.Ok; #pragma warning restore CS0618 // Type or member is obsolete this.CheckStatus = checkStatus; this.Version = version; this.Message = message; this.InnerException = innerException; }
/// <summary> /// Performs a comparision of this WildcardDependencyVersion with another DependencyVersion object. /// </summary> /// <param name="other">The DependencyVersion to compare this WildcardDependencyVersion to.</param> /// <returns>Returns 1 if the first version is bigger than the second version. /// Returns -1 if the first version is lesser than the second version. /// Return 0 if both versions are equal.</returns> public override int CompareTo(DependencyVersion other) { if (ReferenceEquals(this, other)) { return(0); } if (ReferenceEquals(other, null)) { return(1); } if (other is WildcardDependencyVersion) { return(this.CompareTo((WildcardDependencyVersion)other)); } if (this.IsMajorWildcard) { return(1); } var r = this.Major.CompareTo(other.Major); if (r != 0) { return(r); } if (this.IsMinorWildcard) { return(1); } r = this.Minor.CompareTo(other.Minor); if (r != 0) { return(r); } return(1); }