protected Unit UnitPixelTypeCheck(object obj, Unit defaultValue, string propertyName)
{
Unit temp = (obj == null) ? defaultValue : (Unit)obj;
if (temp.Type != UnitType.Pixel)
{
throw new InvalidCastException("The Unit Type for the {0} {1} property must be of Type 'Pixel'. Example: Unit.Pixel(150) or '150px'.".FormatWith(this.ID, propertyName));
}
return temp;
}