internal static void RegisterSchemaElement(IEdmSchemaElement element, Dictionary <string, IEdmSchemaType> schemaTypeDictionary, Dictionary <string, IEdmValueTerm> valueTermDictionary, Dictionary <string, object> functionGroupDictionary, Dictionary <string, IEdmEntityContainer> containerDictionary)
        {
            string str = element.FullName();
            EdmSchemaElementKind schemaElementKind = element.SchemaElementKind;

            switch (schemaElementKind)
            {
            case EdmSchemaElementKind.None:
            {
                throw new InvalidOperationException(Strings.EdmModel_CannotUseElementWithTypeNone);
            }

            case EdmSchemaElementKind.TypeDefinition:
            {
                RegistrationHelper.AddElement <IEdmSchemaType>((IEdmSchemaType)element, str, schemaTypeDictionary, new Func <IEdmSchemaType, IEdmSchemaType, IEdmSchemaType>(RegistrationHelper.CreateAmbiguousTypeBinding));
                return;
            }

            case EdmSchemaElementKind.Function:
            {
                RegistrationHelper.AddFunction <IEdmFunction>((IEdmFunction)element, str, functionGroupDictionary);
                return;
            }

            case EdmSchemaElementKind.ValueTerm:
            {
                RegistrationHelper.AddElement <IEdmValueTerm>((IEdmValueTerm)element, str, valueTermDictionary, new Func <IEdmValueTerm, IEdmValueTerm, IEdmValueTerm>(RegistrationHelper.CreateAmbiguousValueTermBinding));
                return;
            }

            case EdmSchemaElementKind.EntityContainer:
            {
                RegistrationHelper.AddElement <IEdmEntityContainer>((IEdmEntityContainer)element, str, containerDictionary, new Func <IEdmEntityContainer, IEdmEntityContainer, IEdmEntityContainer>(RegistrationHelper.CreateAmbiguousEntityContainerBinding));
                RegistrationHelper.AddElement <IEdmEntityContainer>((IEdmEntityContainer)element, element.Name, containerDictionary, new Func <IEdmEntityContainer, IEdmEntityContainer, IEdmEntityContainer>(RegistrationHelper.CreateAmbiguousEntityContainerBinding));
                return;
            }
            }
            throw new InvalidOperationException(Strings.UnknownEnumVal_SchemaElementKind(element.SchemaElementKind));
        }
 internal static void RegisterProperty(IEdmProperty element, string name, Dictionary <string, IEdmProperty> dictionary)
 {
     RegistrationHelper.AddElement <IEdmProperty>(element, name, dictionary, new Func <IEdmProperty, IEdmProperty, IEdmProperty>(RegistrationHelper.CreateAmbiguousPropertyBinding));
 }