示例#1
0
 /// <summary>
 /// Constructor
 /// </summary>
 public Dimension(PredefinedDimensions predefinedDimension) : this()
 {
     switch (predefinedDimension)
     {
         case PredefinedDimensions.Length:
             SetPower(DimensionBase.Length, 1);
             break;
         case PredefinedDimensions.Volume:
             SetPower(DimensionBase.Length, 3);
             break;
         case PredefinedDimensions.LengthPerTime:
             SetPower(DimensionBase.Length, 1);
             SetPower(DimensionBase.Time, -1);
             break;
         case PredefinedDimensions.VolumePerTime:
             SetPower(DimensionBase.Length, 3);
             SetPower(DimensionBase.Time, -1);
             break;
         case PredefinedDimensions.VolumePerTimePerLength:
             SetPower(DimensionBase.Length, 2);
             SetPower(DimensionBase.Time, -1);
             break;
         case PredefinedDimensions.VolumePerTimePerArea:
             SetPower(DimensionBase.Length, 1);
             SetPower(DimensionBase.Time, -1);
             break;
         case PredefinedDimensions.Mass:
             SetPower(DimensionBase.Mass, 1);
             break;
         case PredefinedDimensions.MassPerTime:
             SetPower(DimensionBase.Mass, 1);
             SetPower(DimensionBase.Time, -1);
             break;
     }
 }
示例#2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public Dimension(PredefinedDimensions predefinedDimension) : this()
        {
            switch (predefinedDimension)
            {
            case PredefinedDimensions.Length:
                SetPower(DimensionBase.Length, 1);
                break;

            case PredefinedDimensions.Area:
                SetPower(DimensionBase.Length, 2);
                break;

            case PredefinedDimensions.Volume:
                SetPower(DimensionBase.Length, 3);
                break;

            case PredefinedDimensions.LengthPerTime:
                SetPower(DimensionBase.Length, 1);
                SetPower(DimensionBase.Time, -1);
                break;

            case PredefinedDimensions.VolumePerTime:
                SetPower(DimensionBase.Length, 3);
                SetPower(DimensionBase.Time, -1);
                break;

            case PredefinedDimensions.VolumePerTimePerLength:
                SetPower(DimensionBase.Length, 2);
                SetPower(DimensionBase.Time, -1);
                break;

            case PredefinedDimensions.VolumePerTimePerArea:
                SetPower(DimensionBase.Length, 1);
                SetPower(DimensionBase.Time, -1);
                break;

            case PredefinedDimensions.Mass:
                SetPower(DimensionBase.Mass, 1);
                break;

            case PredefinedDimensions.MassPerTime:
                SetPower(DimensionBase.Mass, 1);
                SetPower(DimensionBase.Time, -1);
                break;
            }
        }