private static void validateDimensionIs(AuxiliaryType auxiliaryType, IDimension dimension, IDimension targetDimension) { if (!dimension.Equals(targetDimension)) { throw new InvalidArgumentException("Wrong Dimension for " + auxiliaryType + ": " + dimension.Name + " instead of " + targetDimension.Name); } }
/// <summary> /// The compare to. /// </summary> /// <param name="other"> /// The other. /// </param> /// <returns> /// The <see cref="int"/> . /// </returns> /// <exception cref="SdmxSemmanticException"> /// Throws Validate exception. /// </exception> public virtual int CompareTo(IDimension other) { if (other.Position == this.Position) { if (!other.Equals(this)) { throw new SdmxSemmanticException( "Two dimensions (" + this.Id + " & " + other.Id + ") can not share the same dimension position : " + this.Position); } } return (other.Position > this.Position) ? -1 : +1; }
public bool CanConvertFrom(IDimension dimension) { return(_sourceDimension.Equals(dimension)); }
public bool CanConvertTo(IDimension dimension) { return(_targetDimension.Equals(dimension)); }