/// <summary> /// Initializes a new instance of the class with a FontSize. /// </summary> /// <param name="type">The font size.</param> public FontUnit(FontSize type) { if (type < FontSize.NotSet || type > FontSize.XXLarge) { throw new ArgumentOutOfRangeException("type"); } _type = type; if (_type == FontSize.AsUnit) { _value = Unit.Point(10); } else { _value = Unit.Empty; } }
/// <summary> /// Initializes a new instance of the class with an integer value. /// </summary> /// <param name="value">The integer value.</param> public FontUnit(int value) { _type = FontSize.AsUnit; _value = Unit.Point(value); }