Пример #1
0
        internal override bool ResolveNameAndSetTypeUsage(
            Converter.ConversionCache convertedItemCache, Dictionary <SchemaElement, GlobalItem> newGlobalItems)
        {
            if (_typeUsage == null)
            {
                if (_typeSubElement != null) //Has sub-elements
                {
                    return(_typeSubElement.ResolveNameAndSetTypeUsage(convertedItemCache, newGlobalItems));
                }
                else //Does not have sub-elements; try to resolve
                {
                    if (_type is ScalarType) //Create and store type usage for scalar type
                    {
                        _typeUsageBuilder.ValidateAndSetTypeUsage(_type as ScalarType, false);
                        _typeUsage = TypeUsage.Create(new CollectionType(_typeUsageBuilder.TypeUsage));
                        return(true);
                    }
                    else //Try to resolve edm type. If not now, it will resolve in the second pass
                    {
                        var edmType =
                            (EdmType)Converter.LoadSchemaElement(_type, _type.Schema.ProviderManifest, convertedItemCache, newGlobalItems);
                        if (edmType != null)
                        {
                            _typeUsageBuilder.ValidateAndSetTypeUsage(edmType, false); //use typeusagebuilder so don't lose facet information
                            _typeUsage = TypeUsage.Create(new CollectionType(_typeUsageBuilder.TypeUsage));
                        }

                        return(_typeUsage != null);
                    }
                }
            }
            return(true);
        }
Пример #2
0
 internal bool ResolveNestedTypeNames(
     Converter.ConversionCache convertedItemCache, Dictionary <SchemaElement, GlobalItem> newGlobalItems)
 {
     if (_typeSubElement == null)
     {
         return(false);
     }
     return(_typeSubElement.ResolveNameAndSetTypeUsage(convertedItemCache, newGlobalItems));
 }
Пример #3
0
 internal bool ResolveNestedTypeNames(
     Converter.ConversionCache convertedItemCache, Dictionary <SchemaElement, GlobalItem> newGlobalItems)
 {
     Debug.Assert(_typeSubElement != null, "Nested type expected.");
     return(_typeSubElement.ResolveNameAndSetTypeUsage(convertedItemCache, newGlobalItems));
 }