public bool Equals(Unit other) { return other == this; }
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(); } }