Пример #1
0
 public bool Equals(Unit other)
 {
     return other == this;
 }
Пример #2
0
 public static int GetCalculatedValue(Unit dimension, int sourceDimension)
 {
     switch (dimension.Type)
     {
         case UnitType.Pixel:
             return (int)dimension.Value;
         case UnitType.Percentage:
             return (int)((dimension.Value / 100.0) * sourceDimension);
         default:
             throw new NotSupportedException();
     }
 }