public static Byte UnboxByte(object value) { if (value is Byte) return (Byte)value; if (value is IConvertible) return CheckNumericPromotion(value).ToByte(null); return (Byte)value; }