UpdateTypeReference() private method

private UpdateTypeReference ( string clrFullTypeName, string currentNamespace, string>.Dictionary nameMappings ) : void
clrFullTypeName string
currentNamespace string
nameMappings string>.Dictionary
return void
Esempio n. 1
0
 private void ProcessProperties(IEnumerable <ContentInfo> properties, List <ClrAnnotation> annotations)
 {
     foreach (ContentInfo child in properties)
     {
         //Child can either be a property directly for attributes or a grouping for content model,
         if (child.ContentType == ContentType.Property)
         {
             ClrPropertyInfo propertyInfo = child as ClrPropertyInfo;
             propertyInfo.UpdateTypeReference(currentFullTypeName, currentNamespace, nameMappings, CreateNestedEnumType);
             typeBuilder.CreateAttributeProperty(child as ClrPropertyInfo, null);
         }
         else
         {
             GroupingInfo rootGroup = child as GroupingInfo;
             if (rootGroup.IsComplex)
             {
                 typeBuilder.StartGrouping(rootGroup);
                 ProcessComplexGroupProperties(rootGroup, annotations);
                 typeBuilder.EndGrouping();
             }
             else
             {
                 ProcessGroup(rootGroup, annotations);
             }
         }
     }
 }
Esempio n. 2
0
        private void ProcessGroup(GroupingInfo grouping, List <ClrAnnotation> annotations)
        {
            typeBuilder.StartGrouping(grouping);
            foreach (ContentInfo child in grouping.Children)
            {
                if (child.ContentType == ContentType.Property)
                {
                    ClrPropertyInfo propertyInfo = child as ClrPropertyInfo;
                    propertyInfo.UpdateTypeReference(currentFullTypeName, currentNamespace, nameMappings, CreateNestedEnumType);
                    typeBuilder.CreateProperty(propertyInfo, annotations);
                }
                else if (child.ContentType == ContentType.WildCardProperty)
                {
                    ClrWildCardPropertyInfo propertyInfo = child as ClrWildCardPropertyInfo;
                    typeBuilder.CreateProperty(propertyInfo, annotations);
                }
                else
                {
                    Debug.Assert(child.ContentType == ContentType.Grouping);
                    ProcessGroup(child as GroupingInfo, annotations);
                }
            }

            typeBuilder.EndGrouping();
        }
 private void ProcessComplexGroupProperties(GroupingInfo grouping, List <ClrAnnotation> annotations)
 {
     foreach (ContentInfo child in grouping.Children)
     {
         if (child.ContentType == ContentType.Property)
         {
             ClrPropertyInfo propertyInfo = child as ClrPropertyInfo;
             propertyInfo.UpdateTypeReference(this.currentFullTypeName, this.currentNamespace, this.nameMappings);
             this.typeBuilder.CreateProperty(propertyInfo, annotations);
         }
         else if (child.ContentType != ContentType.WildCardProperty)
         {
             Debug.Assert(child.ContentType == ContentType.Grouping);
             this.ProcessComplexGroupProperties(child as GroupingInfo, annotations);
         }
         else
         {
             this.typeBuilder.CreateProperty(child as ClrWildCardPropertyInfo, annotations);
         }
     }
 }