protected CsdlSemanticsVocabularyAnnotation(CsdlSemanticsSchema schema, IEdmVocabularyAnnotatable targetContext, CsdlSemanticsAnnotations annotationsContext, CsdlVocabularyAnnotationBase annotation, string qualifier)
     : base(annotation)
 {
     this.schema             = schema;
     this.Annotation         = annotation;
     this.qualifier          = qualifier ?? annotation.Qualifier;
     this.targetContext      = targetContext;
     this.annotationsContext = annotationsContext;
 }
Exemplo n.º 2
0
        private IEdmVocabularyAnnotation WrapVocabularyAnnotation(CsdlVocabularyAnnotationBase annotation, CsdlSemanticsSchema schema, IEdmVocabularyAnnotatable targetContext, CsdlSemanticsAnnotations annotationsContext, string qualifier)
        {
            CsdlSemanticsVocabularyAnnotation annotation2;

            if (!this.wrappedAnnotations.TryGetValue(annotation, out annotation2))
            {
                CsdlValueAnnotation annotation3 = annotation as CsdlValueAnnotation;
                annotation2 = (annotation3 != null) ? ((CsdlSemanticsVocabularyAnnotation) new CsdlSemanticsValueAnnotation(schema, targetContext, annotationsContext, annotation3, qualifier)) : ((CsdlSemanticsVocabularyAnnotation) new CsdlSemanticsTypeAnnotation(schema, targetContext, annotationsContext, (CsdlTypeAnnotation)annotation, qualifier));
                this.wrappedAnnotations[annotation] = annotation2;
            }
            return(annotation2);
        }
Exemplo n.º 3
0
 private IEdmVocabularyAnnotation WrapVocabularyAnnotation(CsdlVocabularyAnnotationBase annotation, CsdlSemanticsSchema schema, IEdmVocabularyAnnotatable targetContext, CsdlSemanticsAnnotations annotationsContext, string qualifier)
 {
     return(EdmUtil.DictionaryGetOrUpdate(
                this.wrappedAnnotations,
                annotation,
                ann =>
     {
         CsdlValueAnnotation valueAnnotation = ann as CsdlValueAnnotation;
         return
         valueAnnotation != null
                 ? (CsdlSemanticsVocabularyAnnotation) new CsdlSemanticsValueAnnotation(schema, targetContext, annotationsContext, valueAnnotation, qualifier)
                 : (CsdlSemanticsVocabularyAnnotation) new CsdlSemanticsTypeAnnotation(schema, targetContext, annotationsContext, (CsdlTypeAnnotation)annotation, qualifier);
     }));
 }
Exemplo n.º 4
0
        protected CsdlSemanticsVocabularyAnnotation(CsdlSemanticsSchema schema, IEdmVocabularyAnnotatable targetContext, CsdlSemanticsAnnotations annotationsContext, CsdlVocabularyAnnotationBase annotation, string qualifier) : base(annotation)
        {
            this.termCache   = new Cache <CsdlSemanticsVocabularyAnnotation, IEdmTerm>();
            this.targetCache = new Cache <CsdlSemanticsVocabularyAnnotation, IEdmVocabularyAnnotatable>();
            this.schema      = schema;
            this.Annotation  = annotation;
            string str  = qualifier;
            string str1 = str;

            if (str == null)
            {
                str1 = annotation.Qualifier;
            }
            this.qualifier          = str1;
            this.targetContext      = targetContext;
            this.annotationsContext = annotationsContext;
        }
Exemplo n.º 5
0
        private IEdmVocabularyAnnotation WrapVocabularyAnnotation(CsdlVocabularyAnnotationBase annotation, CsdlSemanticsSchema schema, IEdmVocabularyAnnotatable targetContext, CsdlSemanticsAnnotations annotationsContext, string qualifier)
        {
            CsdlSemanticsVocabularyAnnotation result;

            // Guarantee that multiple calls to wrap a given annotation all return the same object.
            if (this.wrappedAnnotations.TryGetValue(annotation, out result))
            {
                return(result);
            }

            CsdlValueAnnotation valueAnnotation = annotation as CsdlValueAnnotation;

            result =
                valueAnnotation != null
                ? (CsdlSemanticsVocabularyAnnotation) new CsdlSemanticsValueAnnotation(schema, targetContext, annotationsContext, valueAnnotation, qualifier)
                : (CsdlSemanticsVocabularyAnnotation) new CsdlSemanticsTypeAnnotation(schema, targetContext, annotationsContext, (CsdlTypeAnnotation)annotation, qualifier);

            this.wrappedAnnotations[annotation] = result;
            return(result);
        }