public static bool FromObjToNumericType <N>(object fromObj, N defaultVal, Type xType, out object result)
        {
            var valueUpdated = true;

            result = defaultVal;

            if (xType == TypeClass.ByteClass)
            {
                result = NumericConv.ObjectToByte(fromObj, NumericConv.ObjectToByte(defaultVal));
            }
            else if (xType == TypeClass.SByteClass)
            {
                result = NumericConv.ObjectToSByte(fromObj, NumericConv.ObjectToSByte(defaultVal));
            }
            else if (xType == TypeClass.Int16Class)
            {
                result = NumericConv.ObjectToInt16(fromObj, NumericConv.ObjectToInt16(defaultVal));
            }
            else if (xType == TypeClass.UInt16Class)
            {
                result = NumericConv.ObjectToUInt16(fromObj, NumericConv.ObjectToUInt16(defaultVal));
            }
            else if (xType == TypeClass.Int32Class)
            {
                result = NumericConv.ObjectToInt32(fromObj, NumericConv.ObjectToInt32(defaultVal));
            }
            else if (xType == TypeClass.UInt32Class)
            {
                result = NumericConv.ObjectToUInt32(fromObj, NumericConv.ObjectToUInt32(defaultVal));
            }
            else if (xType == TypeClass.Int64Class)
            {
                result = NumericConv.ObjectToInt64(fromObj, NumericConv.ObjectToInt64(defaultVal));
            }
            else if (xType == TypeClass.UInt64Class)
            {
                result = NumericConv.ObjectToUInt64(fromObj, NumericConv.ObjectToUInt64(defaultVal));
            }
            else if (xType == TypeClass.FloatClass)
            {
                result = NumericConv.ObjectToFloat(fromObj, NumericConv.ObjectToFloat(defaultVal));
            }
            else if (xType == TypeClass.DoubleClass)
            {
                result = NumericConv.ObjectToDouble(fromObj, NumericConv.ObjectToDouble(defaultVal));
            }
            else if (xType == TypeClass.DecimalClass)
            {
                result = NumericConv.ObjectToDecimal(fromObj, NumericConv.ObjectToDecimal(defaultVal));
            }
            else
            {
                valueUpdated = false;
            }

            return(valueUpdated);
        }
        private static bool FromEnumToNumericType <N>(Type enumType, object enumVal, N defaultVal, Type xType, out object result)
        {
            var valueUpdated = true;

            result = defaultVal;

            if (xType == TypeClass.ByteClass)
            {
                result = NumericConv.EnumToByte(enumType, enumVal, NumericConv.ObjectToByte(defaultVal));
            }
            else if (xType == TypeClass.SByteClass)
            {
                result = NumericConv.EnumToSByte(enumType, enumVal, NumericConv.ObjectToSByte(defaultVal));
            }
            else if (xType == TypeClass.Int16Class)
            {
                result = NumericConv.EnumToInt16(enumType, enumVal, NumericConv.ObjectToInt16(defaultVal));
            }
            else if (xType == TypeClass.UInt16Class)
            {
                result = NumericConv.EnumToUInt16(enumType, enumVal, NumericConv.ObjectToUInt16(defaultVal));
            }
            else if (xType == TypeClass.Int32Class)
            {
                result = NumericConv.EnumToInt32(enumType, enumVal, NumericConv.ObjectToInt32(defaultVal));
            }
            else if (xType == TypeClass.UInt32Class)
            {
                result = NumericConv.EnumToUInt32(enumType, enumVal, NumericConv.ObjectToUInt32(defaultVal));
            }
            else if (xType == TypeClass.Int64Class)
            {
                result = NumericConv.EnumToInt64(enumType, enumVal, NumericConv.ObjectToInt64(defaultVal));
            }
            else if (xType == TypeClass.UInt32Class)
            {
                result = NumericConv.EnumToUInt64(enumType, enumVal, NumericConv.ObjectToUInt64(defaultVal));
            }
            else
            {
                valueUpdated = false;
            }

            return(valueUpdated);
        }