public ConvertorInstance(IUnitConversion conversionEntry, IServiceLocator locator) { if (!string.IsNullOrWhiteSpace(conversionEntry.ConvertorClass)) { m_convertor = locator.InstantiateNow <IUnitConvertor>(conversionEntry.ConvertorClass); } else { if (conversionEntry.Multiplier == null) { throw new InvalidOperationException("Conversion must have convertor class or mutiplier"); } m_convertor = new DefaultConvertor(conversionEntry.Multiplier.Value); } }
public void Initialize() { convertor = new AlcolizerConvertor(); }
public Circle(int radius, IUnitConvertor unitConvertor) : base(unitConvertor) { RadiusCm = radius; }
public Triangle(int @base, int height, IUnitConvertor unitConvertor) : base(unitConvertor) { BaseCm = @base; HeightCm = height; }
public Square(int side, IUnitConvertor unitConvertor) : base(unitConvertor) { SideCm = side; }
protected Shape(IUnitConvertor unitConvertor) { UnitConvertor = unitConvertor; }