/// <summary> /// Initializes a new instance of the <see cref="UnitReductionResult" /> class. /// </summary> /// <param name="flatRepresentation">The flat representation.</param> /// <param name="expression">The expression.</param> /// <param name="reduceByBaseUnit">If set to <c>true</c> reducing was performed using the base unit.</param> /// <param name="reductions">The reductions.</param> /// <param name="hasReductions">If set to <c>true</c> the result has reductions.</param> public UnitReductionResult( FlatRepresentation flatRepresentation, Expression expression, bool reduceByBaseUnit, IEnumerable <Reduction> reductions, bool hasReductions) : base(flatRepresentation, expression, reduceByBaseUnit) { this.Reductions = reductions; this.HasReductions = hasReductions; }
/// <summary> /// Initializes a new instance of the <see cref="UnitReductionResult" /> class. /// </summary> /// <param name="flatRepresentation">The flat representation.</param> /// <param name="expression">The expression.</param> /// <param name="reduceByBaseUnit">If set to <c>true</c> reducing was performed using the base unit.</param> /// <param name="reductions">The reductions.</param> /// <param name="hasReductions">If set to <c>true</c> the result has reductions.</param> public UnitReductionResult( FlatRepresentation flatRepresentation, Expression expression, bool reduceByBaseUnit, IEnumerable<Reduction> reductions, bool hasReductions) : base(flatRepresentation, expression, reduceByBaseUnit) { this.Reductions = reductions; this.HasReductions = hasReductions; }
/// <summary> /// Tries to get the unit. /// </summary> /// <param name="flatRepresentation">The flat representation.</param> /// <param name="derivedUnit">The found derived unit.</param> /// <returns> /// <c>true</c> if the flat representation is found, otherwise <c>false</c> /// </returns> public bool TryGetUnit(FlatRepresentation flatRepresentation, out DerivedUnit derivedUnit) { return this.derivedUnits.TryGetValue(flatRepresentation, out derivedUnit); }
/// <summary> /// Tries to get the unit. /// </summary> /// <param name="flatRepresentation">The flat representation.</param> /// <param name="derivedUnit">The found derived unit.</param> /// <returns> /// <c>true</c> if the flat representation is found, otherwise <c>false</c> /// </returns> public bool TryGetUnit(FlatRepresentation flatRepresentation, out DerivedUnit derivedUnit) { return(this.derivedUnits.TryGetValue(flatRepresentation, out derivedUnit)); }
/// <summary> /// Initializes a new instance of the <see cref="ReductionResult"/> class. /// </summary> /// <param name="flatRepresentation">The flat representation.</param> /// <param name="expression">The expression.</param> /// <param name="reduceByBaseUnit">If set to <c>true</c> reducing was performed using the base unit.</param> public ReductionResult(FlatRepresentation flatRepresentation, Expression expression, bool reduceByBaseUnit) { this.expression = expression; this.reduceByBaseUnit = reduceByBaseUnit; this.FlatRepresentation = flatRepresentation; }
/// <summary> /// Initializes a new instance of the <see cref="ReductionResult"/> class. /// </summary> /// <param name="flatRepresentation">The flat representation.</param> /// <param name="expression">The expression.</param> /// <param name="reduceByBaseUnit">If set to <c>true</c> reducing was performed using the base unit.</param> public ReductionResult(FlatRepresentation flatRepresentation, Expression expression, bool reduceByBaseUnit) { this.expression = expression; this.reduceByBaseUnit = reduceByBaseUnit; this.FlatRepresentation = flatRepresentation; }