Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="derivedDimension"></param>
        /// <returns></returns>
        private static IEnumerable <IDimension> EnumerateAll(this IDerivedDimension derivedDimension)
        {
            if (derivedDimension == null)
            {
                yield break;
            }

            foreach (var d in derivedDimension.Dimensions)
            {
                foreach (var c in
                         from x in (d as IDerivedDimension).EnumerateAll()
                         select(IDimension) x.Clone())
                {
                    c.Exponent *= derivedDimension.Exponent;
                    yield return(c);
                }

                if (d is IDerivedDimension)
                {
                    continue;
                }

                var cloned = (IDimension)d.Clone();

                yield return(cloned);
            }
        }
 private static bool Equals(IDerivedDimension a, IDimension b)
 {
     return(!(a == null || b == null) &&
            a.IsDimensionEquals(b) &&
            a.AreEquivalent(b as IDerivedDimension) &&
            a.Exponent == b.Exponent);
 }
 private static bool Equals(IDerivedDimension a, IDimension b)
 {
     return !(a == null || b == null)
            && a.IsDimensionEquals(b)
            && a.AreEquivalent(b as IDerivedDimension)
            && a.Exponent == b.Exponent;
 }
Example #4
0
 /// <summary>
 /// Registers the <paramref name="dimension"/> of type <see cref="IDerivedDimension"/>.
 /// </summary>
 /// <param name="dimension"></param>
 protected static void Register(IDerivedDimension dimension)
 {
     Register <IDerivedDimension>(dimension);
 }
Example #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="dimension"></param>
 /// <param name="other"></param>
 /// <returns></returns>
 public static bool AreEquivalent(this IDerivedDimension dimension, IDerivedDimension other)
 {
     return(!(dimension == null || other == null) &&
            dimension.Dimensions.AreEquivalent(other.Dimensions));
 }