/// <summary> /// Instantites the <see cref="BitmapMemoryCacheKey"/>. /// </summary> public BitmapMemoryCacheKey( string sourceString, ResizeOptions resizeOptions, bool autoRotated, ImageDecodeOptions imageDecodeOptions, ICacheKey postprocessorCacheKey, string postprocessorName, object callerContext) { _sourceString = Preconditions.CheckNotNull(sourceString); _resizeOptions = resizeOptions; _autoRotated = autoRotated; _imageDecodeOptions = imageDecodeOptions; _postprocessorCacheKey = postprocessorCacheKey; _postprocessorName = postprocessorName; _hash = HashCodeUtil.HashCode( sourceString.GetHashCode(), (resizeOptions != null) ? resizeOptions.GetHashCode() : 0, autoRotated ? true.GetHashCode() : false.GetHashCode(), _imageDecodeOptions, _postprocessorCacheKey, postprocessorName); _callerContext = callerContext; _cacheTime = SystemClock.UptimeMillis; }
/// <summary> /// Gets the directory to use to store the given key. /// </summary> /// <param name="resourceId"> /// The id of the file we're going to store. /// </param> /// <returns>The directory to store the file in.</returns> private string GetSubdirectoryPath(string resourceId) { int hashCode = HashCodeUtil.HashCode(resourceId); string subdirectory = Math.Abs(hashCode % SHARDING_BUCKET_COUNT).ToString(); return(Path.Combine(_versionDirectory.FullName, subdirectory)); }
public void GetCombinedHash_ReturnsZero_ForNullishArray(ArrayType type) { var arr = (object[])null; // ReSharper disable once SwitchStatementMissingSomeCases switch (type) { case ArrayType.Empty: arr = _empty; break; case ArrayType.OnlyNulls: arr = _onlyNulls; break; } var hash = HashCodeUtil.GetCombinedHash(arr); Assert.Equal(0, hash); }
public void GetCombinedHash_ReturnsNonZero_ForNonNullishArray(ArrayType type) { object[] arr; // ReSharper disable once SwitchStatementMissingSomeCases switch (type) { case ArrayType.SomeNulls: arr = _someNulls; break; case ArrayType.NoNulls: arr = _noNulls; break; default: throw new InvalidOperationException(); } var hash = HashCodeUtil.GetCombinedHash(arr); Assert.NotEqual(0, hash); }
public override int GetHashCode() => HashCodeUtil.CombineHashCodes(this.point.GetHashCode(), this.hitTestMetrics.GetHashCode());
public override int GetHashCode() => HashCodeUtil.CombineHashCodes(this.designUnitsPerEm.GetHashCode(), this.ascent.GetHashCode(), this.descent.GetHashCode(), this.lineGap.GetHashCode(), this.capHeight.GetHashCode(), this.xHeight.GetHashCode(), this.underlinePosition.GetHashCode(), this.underlineThickness.GetHashCode(), this.strikethroughPosition.GetHashCode(), this.strikethroughThickness.GetHashCode());
public override int GetHashCode() => HashCodeUtil.CombineHashCodes((int)this.nameTag, this.parameter.GetHashCode());
public override int GetHashCode() => HashCodeUtil.CombineHashCodes(this.textRange.GetHashCode(), this.value.GetHashCode());
public override int GetHashCode() => HashCodeUtil.CombineHashCodes(this.point.GetHashCode(), this.tangent.GetHashCode());
public override int GetHashCode() => HashCodeUtil.CombineHashCodes((int)this.granularity, this.delimiter.GetHashCode(), this.delimiterCount.GetHashCode());
public override int GetHashCode() { return(HashCodeUtil.GetCombinedHash(ResponseHeaders, ContentType, Content, Status)); }
public override int GetHashCode() => HashCodeUtil.CombineHashCodes(this.isTrailingHit.GetHashCode(), this.isInside.GetHashCode(), this.hitTestMetrics.GetHashCode());
public override int GetHashCode() => HashCodeUtil.CombineHashCodes((this.assembly == null) ? 0 : this.assembly.GetHashCode(), (this.filePath == null) ? 0 : this.filePath.GetHashCode(), (this.Type == null) ? 0 : this.Type.GetHashCode(), this.ErrorString.GetHashCode());
public override int GetHashCode() => HashCodeUtil.CombineHashCodes(this.width.GetHashCode(), this.thickness.GetHashCode(), this.offset.GetHashCode(), (int)this.readingDirection, (int)this.flowDirection, this.locale.GetHashCode(), (int)this.measuringMode);
public override int GetHashCode() { return(HashCodeUtil.GetCombinedHash(ConditionName, Success, Info)); }
public override int GetHashCode() => HashCodeUtil.CombineHashCodes(this.trimmingOptions.GetHashCode(), this.trimmingSign.GetHashCode());
public override int GetHashCode() => HashCodeUtil.CombineHashCodes((int)this.Constraint, (int)this.Elide, (int)this.Transform, (int)this.Snapping);
public override int GetHashCode() { return(HashCodeUtil.GetCombinedHash(Check, Time, Outcome, Details)); }
public override int GetHashCode() => HashCodeUtil.CombineHashCodes(this.length.GetHashCode(), this.trailingWhitespaceLength.GetHashCode(), this.newlineLength.GetHashCode(), this.height.GetHashCode(), this.baseline.GetHashCode());
public override int GetHashCode() => HashCodeUtil.CombineHashCodes(this.left.GetHashCode(), this.top.GetHashCode(), this.right.GetHashCode(), this.bottom.GetHashCode());
public override int GetHashCode() => HashCodeUtil.CombineHashCodes(this.textPosition.GetHashCode(), this.length.GetHashCode(), this.left.GetHashCode(), this.top.GetHashCode(), this.width.GetHashCode(), this.height.GetHashCode(), this.bidiLevel.GetHashCode(), this.isText.GetHashCode(), this.isTrimmed.GetHashCode());
/// <summary> /// Calculates the hash code basing on width and height. /// </summary> public override int GetHashCode() { return(HashCodeUtil.HashCode(Width, Height)); }
public override int GetHashCode() => HashCodeUtil.CombineHashCodes(this.position.GetHashCode(), HashCodeUtil.CreateHashCode <byte>(this.pattern), HashCodeUtil.CreateHashCode <byte>(this.mask), this.dataOffset.GetHashCode());
public override int GetHashCode() { return(HashCodeUtil.GetCombinedHash(Environments, Services, Checks)); }
public int GetHashCode(ref TMatrix m) => HashCodeUtil.CombineHashCodes(m.M11.GetHashCode(), m.M12.GetHashCode(), m.M21.GetHashCode(), m.M22.GetHashCode(), m.OffsetX.GetHashCode(), m.OffsetY.GetHashCode());
public override int GetHashCode() => HashCodeUtil.CombineHashCodes(this.point.GetHashCode(), this.unitTangentVector.GetHashCode(), this.endSegment, this.endFigure, this.lengthToEndSegment.GetHashCode());
public override int GetHashCode() { return(HashCodeUtil.GetCombinedHash(Value, Args, Op, StopOnFail)); }
public override int GetHashCode() => HashCodeUtil.CombineHashCodes(this.startPoint.GetHashCode(), this.endPoint.GetHashCode());
/// <summary> /// Custom GetHashCode method. /// </summary> public override int GetHashCode() { return(HashCodeUtil.HashCode(CacheChoice, SourceUri, SourceFile)); }
public override int GetHashCode() => HashCodeUtil.CombineHashCodes(this.factoryType.GetHashCode(), this.id.GetHashCode());