Ext.Net.GridCommand.UnitPixelTypeCheck C# (CSharp) Method

UnitPixelTypeCheck() static private method

static private UnitPixelTypeCheck ( object obj, System.Web.UI.WebControls.Unit defaultValue, string propertyName ) : System.Web.UI.WebControls.Unit
obj object
defaultValue System.Web.UI.WebControls.Unit
propertyName string
return System.Web.UI.WebControls.Unit
        internal static 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 GridCommand {0} property must be of Type 'Pixel'. Example: Unit.Pixel(150) or '150px'.".FormatWith(propertyName));
            }

            return temp;
        }
    }