InferWoopsaType() публичный статический Метод

Determines the WoopsaValueType based on a .NET type.
public static InferWoopsaType ( Type targetType, WoopsaValueType &resultType ) : bool
targetType System.Type The .NET type to try to get the WoopsaValueType from
resultType WoopsaValueType The inferred WoopsaValueType. If the type cannot be inferred, this value will be WoopsaValueType.Null
Результат bool
Пример #1
0
 private static bool InferWoopsaType(WoopsaConverters customValueTypeConverters, Type type, out WoopsaValueType woopsaValueType, out WoopsaConverter converter)
 {
     if (customValueTypeConverters != null)
     {
         return(customValueTypeConverters.InferWoopsaType(type, out woopsaValueType, out converter));
     }
     else
     {
         converter = WoopsaConverterDefault.Default;
         return(WoopsaTypeUtils.InferWoopsaType(type, out woopsaValueType));
     }
 }
Пример #2
0
        public virtual bool InferWoopsaType(Type type, out WoopsaValueType woopsaValueType, out WoopsaConverter converter)
        {
            WoopsaConverterDescription converterDescription;

            if (_converterDescriptions.TryGetValue(type, out converterDescription))
            {
                woopsaValueType = converterDescription.WoopsaValueType;
                converter       = converterDescription.Converter;
                return(true);
            }
            else
            {
                converter = WoopsaConverterDefault.Default;
                return(WoopsaTypeUtils.InferWoopsaType(type, out woopsaValueType));
            }
        }