public static TypePropertyBuilder Create(GroupingInfo groupingInfo, CodeTypeDeclaration decl,
                                                 CodeTypeDeclItems declItems)
        {
            switch (groupingInfo.ContentModelType)
            {
            case ContentModelType.None:
            case ContentModelType.All:
                return(new DefaultPropertyBuilder(decl, declItems));

            case ContentModelType.Sequence:
                if (groupingInfo.IsComplex)
                {
                    return(new DefaultPropertyBuilder(decl, declItems));
                }

                return(new SequencePropertyBuilder(groupingInfo, decl, declItems));

            case ContentModelType.Choice:
                if (groupingInfo.IsComplex)
                {
                    return(new DefaultPropertyBuilder(decl, declItems));
                }

                return(new ChoicePropertyBuilder(groupingInfo, decl, declItems));

            default:
                throw new InvalidOperationException();
            }
        }
Beispiel #2
0
 public ChoicePropertyBuilder(GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems)
     : base(grouping, decl, declItems)
 {
     flatChoice = !grouping.IsNested && !grouping.IsRepeating && !grouping.HasChildGroups;
     hasDuplicateType = false;
     if (flatChoice) {
         propertyTypeNameTable = new Dictionary<string,ClrBasePropertyInfo>();
     }
 }
        public static TypePropertyBuilder Create(ContentModelPropertyBuilder parentBuilder, GroupingInfo groupingInfo, CodeTypeDeclaration decl,
                                                 CodeTypeDeclItems declItems, GeneratedTypesVisibility visibility = GeneratedTypesVisibility.Public)
        {
            switch (groupingInfo.ContentModelType)
            {
            case ContentModelType.None:
            case ContentModelType.All:
                return(new DefaultPropertyBuilder(decl, declItems, visibility));

            case ContentModelType.Sequence:
                return(new SequencePropertyBuilder(parentBuilder, groupingInfo, decl, declItems, visibility));

            case ContentModelType.Choice:
                return(new ChoicePropertyBuilder(parentBuilder, groupingInfo, decl, declItems, visibility));

            default:
                throw new InvalidOperationException();
            }
        }
Beispiel #4
0
 protected new void InnerInit()
 {
     base.InnerInit();
     this.propertyBuilder = null;
     if (this.propertyBuilderStack != null)
     {
         this.propertyBuilderStack.Clear();
     }
     if (this.propertyDictionaryAddStatements != null)
     {
         this.propertyDictionaryAddStatements.Clear();
     }
     if (this.declItemsInfo != null)
     {
         this.declItemsInfo.Init();
     }
     else
     {
         this.declItemsInfo = new CodeTypeDeclItems();
     }
 }
Beispiel #5
0
        public static TypePropertyBuilder Create(GroupingInfo groupingInfo, CodeTypeDeclaration decl, CodeTypeDeclItems declItems) {
            switch (groupingInfo.ContentModelType) {
                case ContentModelType.None:
                case ContentModelType.All:
                    return new DefaultPropertyBuilder(decl, declItems);

                case ContentModelType.Sequence:
                    if (groupingInfo.IsComplex) {
                        return new DefaultPropertyBuilder(decl, declItems);
                    }
                    return new SequencePropertyBuilder(groupingInfo, decl, declItems);

                case ContentModelType.Choice:
                    if (groupingInfo.IsComplex) {
                        return new DefaultPropertyBuilder(decl, declItems);
                    }
                    return new ChoicePropertyBuilder(groupingInfo, decl, declItems);

                default:
                    throw new InvalidOperationException();
            }
        }
Beispiel #6
0
 internal DefaultPropertyBuilder(CodeTypeDeclaration decl, CodeTypeDeclItems declItems) : base(decl, declItems) {
 }
Beispiel #7
0
 public static TypePropertyBuilder Create(CodeTypeDeclaration decl, CodeTypeDeclItems declItems)
 {
     return(new DefaultPropertyBuilder(decl, declItems));
 }
Beispiel #8
0
 public TypePropertyBuilder(CodeTypeDeclaration decl, CodeTypeDeclItems declItems)
 {
     this.decl      = decl;
     this.declItems = declItems;
 }
Beispiel #9
0
 public SequencePropertyBuilder(GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems) : base(grouping, decl, declItems)
 {
 }
Beispiel #10
0
        // InnerInit is a non-virtual function to
        // prevent virtual methods from being called
        // in the call stack of the constructor
        protected new void InnerInit() {
            base.InnerInit();
            propertyBuilder = null;
            if (propertyBuilderStack != null) {
                propertyBuilderStack.Clear();
            }
            if (propertyDictionaryAddStatements != null) {
                propertyDictionaryAddStatements.Clear();
            }
            if (declItemsInfo == null) {
                declItemsInfo = new CodeTypeDeclItems();
            }
            else {
                declItemsInfo.Init();
            }
         

        }
 public static TypePropertyBuilder Create(CodeTypeDeclaration decl, CodeTypeDeclItems declItems,
                                          GeneratedTypesVisibility visibility = GeneratedTypesVisibility.Public)
 {
     return(new DefaultPropertyBuilder(decl, declItems, visibility));
 }
 internal DefaultPropertyBuilder(CodeTypeDeclaration decl, CodeTypeDeclItems declItems,
                                 GeneratedTypesVisibility visibility = GeneratedTypesVisibility.Public) : base(decl, declItems, visibility)
 {
 }
 public TypePropertyBuilder(CodeTypeDeclaration decl, CodeTypeDeclItems declItems, GeneratedTypesVisibility visibility)
 {
     this.decl       = decl;
     this.declItems  = declItems;
     this.visibility = visibility;
 }
 public ChoicePropertyBuilder(ContentModelPropertyBuilder parentBuilder, GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems,
                              GeneratedTypesVisibility visibility = GeneratedTypesVisibility.Public) :
     base(parentBuilder, grouping, decl, declItems, visibility)
 {
     flatChoice       = !grouping.IsNested && !grouping.IsRepeating && !grouping.HasChildGroups;
     hasDuplicateType = false;
     if (flatChoice)
     {
         propertyTypeNameTable = new Dictionary <string, ClrBasePropertyInfo>();
     }
 }
 public SequencePropertyBuilder(ContentModelPropertyBuilder parentBuilder, GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems,
                                GeneratedTypesVisibility visibility = GeneratedTypesVisibility.Public) :
     base(parentBuilder, grouping, decl, declItems, visibility)
 {
 }
Beispiel #16
0
 public static TypePropertyBuilder Create(CodeTypeDeclaration decl, CodeTypeDeclItems declItems) {
     return new DefaultPropertyBuilder(decl, declItems);
 }
Beispiel #17
0
 public ContentModelPropertyBuilder(GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems) : base(decl, declItems) {
     this.grouping = grouping; //The grouping the contentmodelbuilder works on
 }
 public ContentModelPropertyBuilder(ContentModelPropertyBuilder parentBuilder, GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems,
                                    GeneratedTypesVisibility visibility)
     : base(decl, declItems, visibility)
 {
     this.ParentBuilder = parentBuilder;
     this.grouping      = grouping; //The grouping the contentmodelbuilder works on
 }
Beispiel #19
0
 public ContentModelPropertyBuilder(GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems) : base(decl, declItems)
 {
     this.grouping = grouping;
 }
Beispiel #20
0
        public static TypePropertyBuilder Create(GroupingInfo groupingInfo, CodeTypeDeclaration decl, CodeTypeDeclItems declItems)
        {
            TypePropertyBuilder defaultPropertyBuilder;

            switch (groupingInfo.ContentModelType)
            {
            case ContentModelType.None:
            case ContentModelType.All:
            {
                defaultPropertyBuilder = new DefaultPropertyBuilder(decl, declItems);
                break;
            }

            case ContentModelType.Sequence:
            {
                if (!groupingInfo.IsComplex)
                {
                    defaultPropertyBuilder = new SequencePropertyBuilder(groupingInfo, decl, declItems);
                    break;
                }
                else
                {
                    defaultPropertyBuilder = new DefaultPropertyBuilder(decl, declItems);
                    break;
                }
            }

            case ContentModelType.Choice:
            {
                if (!groupingInfo.IsComplex)
                {
                    defaultPropertyBuilder = new ChoicePropertyBuilder(groupingInfo, decl, declItems);
                    break;
                }
                else
                {
                    defaultPropertyBuilder = new DefaultPropertyBuilder(decl, declItems);
                    break;
                }
            }

            default:
            {
                throw new InvalidOperationException();
            }
            }
            return(defaultPropertyBuilder);
        }
Beispiel #21
0
 public ChoicePropertyBuilder(GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems) : base(grouping, decl, declItems)
 {
     flatChoice       = !grouping.IsNested && !grouping.IsRepeating && !grouping.HasChildGroups;
     hasDuplicateType = false;
     if (flatChoice)
     {
         propertyTypeNameTable = new Dictionary <string, ClrBasePropertyInfo>();
     }
 }
Beispiel #22
0
 public SequencePropertyBuilder(GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems) : base(grouping, decl, declItems) {
 }
Beispiel #23
0
 internal DefaultPropertyBuilder(CodeTypeDeclaration decl, CodeTypeDeclItems declItems) : base(decl, declItems)
 {
 }
Beispiel #24
0
 public TypePropertyBuilder(CodeTypeDeclaration decl, CodeTypeDeclItems declItems) {
     this.decl = decl;
     this.declItems = declItems;
 }
Beispiel #25
0
 public ContentModelPropertyBuilder(GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems) : base(decl, declItems)
 {
     this.grouping = grouping; //The grouping the contentmodelbuilder works on
 }
Beispiel #26
0
 public SequencePropertyBuilder(GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems,
                                GeneratedTypesVisibility visibility = GeneratedTypesVisibility.Public) :
     base(grouping, decl, declItems, visibility)
 {
 }