示例#1
0
        private static ICuboidEntity CuboidByLengthsCore(ICoordinateSystemEntity contextCoordinateSystem, double length, double width, double height)
        {
            string kMethod = "Cuboid.ByLengths";

            if (length.LessThanOrEqualTo(0.0))
            {
                throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "length"), "length");
            }
            if (height.LessThanOrEqualTo(0.0))
            {
                throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "height"), "height");
            }
            if (width.LessThanOrEqualTo(0.0))
            {
                throw new System.ArgumentException(string.Format(Properties.Resources.LessThanZero, "width"), "width");
            }
            if (null == contextCoordinateSystem)
            {
                throw new System.ArgumentNullException("contextCoordinateSystem");
            }
            if (!contextCoordinateSystem.IsScaledOrtho())
            {
                throw new System.ArgumentException(string.Format(Properties.Resources.InvalidInput, "Shear CoordinateSystem", kMethod));
            }

            ICuboidEntity entity = HostFactory.Factory.CuboidByLengths(contextCoordinateSystem, length, width, height);

            if (null == entity)
            {
                throw new System.Exception(string.Format(Properties.Resources.OperationFailed, kMethod));
            }
            return(entity);
        }
示例#2
0
        private void InitializeGuaranteedProperties(ICuboidEntity entity = null)
        {
            ICuboidEntity cuboidEntity = entity;

            if (entity == null)
            {
                cuboidEntity = CuboidEntity;
            }
        }
示例#3
0
 private Cuboid(ICuboidEntity entity, bool persist = false)
     : base(entity, persist)
 {
     InitializeGuaranteedProperties();
 }
示例#4
0
 private void InitializeGuaranteedProperties(ICuboidEntity entity = null)
 {
     ICuboidEntity cuboidEntity = entity;
     if (entity == null)
         cuboidEntity = CuboidEntity;
 }
示例#5
0
 private Cuboid(ICuboidEntity entity, bool persist = false)
     : base(entity, persist)
 {
     InitializeGuaranteedProperties();
 }