protected CsdlSemanticsElement(CsdlElement element) { if (element != null) { if (element.HasDirectValueAnnotations) { this.directValueAnnotationsCache = new Cache <CsdlSemanticsElement, IEnumerable <IEdmDirectValueAnnotation> >(); } if (element.HasVocabularyAnnotations) { this.inlineVocabularyAnnotationsCache = new Cache <CsdlSemanticsElement, IEnumerable <IEdmVocabularyAnnotation> >(); } } }
protected CsdlSemanticsElement(CsdlElement element) { if (element != null) { // Many elements have no attached annotations. For these, save the allocation of the cache and the cost of the cache mechanism. if (element.HasDirectValueAnnotations) { this.directValueAnnotationsCache = new Cache <CsdlSemanticsElement, IEnumerable <IEdmDirectValueAnnotation> >(); } if (element.HasVocabularyAnnotations) { this.inlineVocabularyAnnotationsCache = new Cache <CsdlSemanticsElement, IEnumerable <IEdmVocabularyAnnotation> >(); } } }
protected override void AnnotateItem(object result, XmlElementValueCollection childValues) { CsdlElement annotatedItem = result as CsdlElement; if (annotatedItem == null) { return; } foreach (var xmlAnnotation in this.currentElement.Annotations) { annotatedItem.AddAnnotation(new CsdlDirectValueAnnotation(xmlAnnotation.NamespaceName, xmlAnnotation.Name, xmlAnnotation.Value, xmlAnnotation.IsAttribute, xmlAnnotation.Location)); } foreach (var annotation in childValues.ValuesOfType <CsdlAnnotation>()) { annotatedItem.AddAnnotation(annotation); } }
protected CsdlSemanticsTypeDefinition(CsdlElement element) : base(element) { }