Ejemplo n.º 1
0
        public static ConversionSet GetSetByType(UnitConverter.ConversionTypes type)
        {
            switch (type)
            {
            case UnitConverter.ConversionTypes.distance:
                return(new LengthUnit());

            case UnitConverter.ConversionTypes.mass:
                return(new MassUnit());

            case UnitConverter.ConversionTypes.speed:
                return(new SpeedUnit());

            case UnitConverter.ConversionTypes.volume:
                return(new VolumeUnit());

            case UnitConverter.ConversionTypes.area:
                return(new AreaUnit());

            case UnitConverter.ConversionTypes.acceleration:
                return(new AccelerationUnit());

            case UnitConverter.ConversionTypes.angles:
                return(new AnglesUnit());

            case UnitConverter.ConversionTypes.current:
                return(new CurrentUnit());

            default:
                return(new LengthUnit());
            }
        }
Ejemplo n.º 2
0
 //This constructor must be called from all of the inheritors, then they need to initialize the values for each
 public ConversionSet(UnitConverter.ConversionTypes type, int index)
 {
     units       = null;
     filters     = null;
     conversions = null;
     masks       = new List <int[]>();
     this.type   = type;
     this.index  = index;
 }