internal override bool ResolveNameAndSetTypeUsage(Converter.ConversionCache convertedItemCache, Dictionary <Som.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 { EdmType edmType = (EdmType)Converter.LoadSchemaElement(_type, _type.Schema.ProviderManifest, convertedItemCache, newGlobalItems); if (edmType != null) { _typeUsageBuilder.ValidateAndSetTypeUsage(edmType, false); //use typeusagebuilder so dont lose facet information _typeUsage = TypeUsage.Create(new CollectionType(_typeUsageBuilder.TypeUsage)); } return(_typeUsage != null); } } } return(true); }
internal bool ResolveNestedTypeNames(Converter.ConversionCache convertedItemCache, Dictionary <Som.SchemaElement, GlobalItem> newGlobalItems) { if (_typeSubElement == null) { return(false); } return(_typeSubElement.ResolveNameAndSetTypeUsage(convertedItemCache, newGlobalItems)); }
internal bool ResolveNestedTypeNames(Converter.ConversionCache convertedItemCache, Dictionary <Som.SchemaElement, GlobalItem> newGlobalItems) { Debug.Assert(_typeSubElement != null, "Nested type expected."); return(_typeSubElement.ResolveNameAndSetTypeUsage(convertedItemCache, newGlobalItems)); }