Esempio n. 1
0
        bool TryConvertCustomType(System.Type type, IReferenceMap referenceMap, object?value, bool isOptional, string fullyQualifiedName, out object?result)
        {
            if (IsReferenceType())
            {
                return(TryConvertClass(type, referenceMap, value, out result));
            }

            if (_types.TryGetEnumType(fullyQualifiedName) != null)
            {
                return(TryConvertEnum(value, isOptional, fullyQualifiedName, out result));
            }

            result = null;
            return(false);

            bool IsReferenceType()
            {
                return
                    (_types.TryGetClassType(fullyQualifiedName) != null ||
                     _types.TryGetInterfaceType(fullyQualifiedName) != null ||
                     _types.TryGetProxyType(fullyQualifiedName) != null);
            }
        }