InferWoopsaType() public static method

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
return bool
Esempio n. 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));
     }
 }
Esempio n. 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));
            }
        }