示例#1
0
文件: FontUnit.cs 项目: ynkbt/moon
 /// <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;
     }
 }
示例#2
0
文件: FontUnit.cs 项目: ynkbt/moon
 /// <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);
 }