public bool NeedsUpdate() { if (MinVersion == null) { return(true); } if (MaxVersion == null) { return(true); } var field = GetVersionField(); var minVersionType = MinVersion.GetType(); var maxVersionType = MaxVersion.GetType(); if (field.Type == "byte[]" && minVersionType == typeof(byte[]) && maxVersionType == typeof(byte[])) { var beginBytes = (byte[])MinVersion; var endBytes = (byte[])MaxVersion; return(!beginBytes.SequenceEqual(endBytes)); } if (minVersionType != maxVersionType) { MinVersion = field.Convert(MinVersion.ToString()); MaxVersion = field.Convert(MaxVersion.ToString()); } return(!MinVersion.Equals(MaxVersion)); }
/// <inheritdoc/> public bool Equals(PackageVersionRange other) { if (ReferenceEquals(other, null)) { return(false); } if (ReferenceEquals(other, this)) { return(true); } return(MinVersion.Equals(other.MinVersion) && MaxVersion.Equals(other.MaxVersion) && IsMinInclusive == other.IsMinInclusive && IsMaxInclusive == other.IsMaxInclusive); }
public bool NeedsUpdate() { if (MinVersion == null) { return(true); } if (MaxVersion == null) { return(true); } var field = GetVersionField(); if (field.Type == "byte[]") { var beginBytes = (byte[])MinVersion; var endBytes = (byte[])MaxVersion; return(!beginBytes.SequenceEqual(endBytes)); } return(!MinVersion.Equals(MaxVersion)); }