Пример #1
0
        public ulong GetUInt64(string name)
        {
            Type   foundType;
            object value = GetElement(name, out foundType) !;

            return(ReferenceEquals(foundType, typeof(ulong)) ? (ulong)value : _converter.ToUInt64(value));
        }
Пример #2
0
        public UInt64 GetUInt64(string name)
        {
#if NOT_PFX
            object value = GetValue(name, typeof(System.UInt64));
            return(converter.ToUInt64(value));
#else
            throw new NotSupportedException();
#endif
        }
Пример #3
0
        public ulong GetUInt64(String name)
        {
            Type   foundType;
            Object value;

            value = GetElement(name, out foundType);
            if (Object.ReferenceEquals(foundType, typeof(ulong)))
            {
                return((ulong)value);
            }
            return(m_converter.ToUInt64(value));
        }
 internal static object Convert(IFormatterConverter formatterConverter, object value, TypeCode typeCode)
 {
     return(typeCode switch
     {
         TypeCode.Boolean => formatterConverter.ToBoolean(value),
         TypeCode.Byte => formatterConverter.ToBoolean(value),
         TypeCode.Char => formatterConverter.ToChar(value),
         TypeCode.DateTime => formatterConverter.ToDateTime(value),
         TypeCode.Decimal => formatterConverter.ToDecimal(value),
         TypeCode.Double => formatterConverter.ToDouble(value),
         TypeCode.Int16 => formatterConverter.ToInt16(value),
         TypeCode.Int32 => formatterConverter.ToInt32(value),
         TypeCode.Int64 => formatterConverter.ToInt64(value),
         TypeCode.SByte => formatterConverter.ToSByte(value),
         TypeCode.Single => formatterConverter.ToSingle(value),
         TypeCode.String => formatterConverter.ToString(value),
         TypeCode.UInt16 => formatterConverter.ToUInt16(value),
         TypeCode.UInt32 => formatterConverter.ToUInt32(value),
         TypeCode.UInt64 => formatterConverter.ToUInt64(value),
         _ => throw new NotSupportedException("Unsupported type code: " + typeCode),
     });
Пример #5
0
        public UInt64 GetUInt64(string name)
        {
            object value = GetValue(name, typeof(System.UInt64));

            return(converter.ToUInt64(value));
        }
        public ulong GetUInt64(string name)
        {
            var value = GetValue(name, typeof(ulong));

            return(converter.ToUInt64(value));
        }