Esempio n. 1
0
        public Volume Convert(VolumeUnit volumeUnit)
        {
            var width  = volumeUnit.BaseUnit.Convert(Width);
            var height = volumeUnit.BaseUnit.Convert(Height);
            var depth  = volumeUnit.BaseUnit.Convert(Depth);

            return(new Volume(width.Value, height.Value, depth.Value, volumeUnit));
        }
Esempio n. 2
0
        public double Calculate(VolumeUnit volumeUnit)
        {
            var volume = volumeUnit.Convert(this);

            return(volume.Width.Value * volume.Height.Value * volume.Depth.Value);
        }
Esempio n. 3
0
 public Volume(double width, double height, double depth, VolumeUnit volumeUnit)
 {
     Width  = new Length(width, volumeUnit.BaseUnit);
     Height = new Length(height, volumeUnit.BaseUnit);
     Depth  = new Length(depth, volumeUnit.BaseUnit);
 }