示例#1
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();
            }
        }
示例#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();
            }
        }
示例#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();
     }
 }
示例#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();
            }
        }
示例#6
0
 internal DefaultPropertyBuilder(CodeTypeDeclaration decl, CodeTypeDeclItems declItems) : base(decl, declItems) {
 }
示例#7
0
 public static TypePropertyBuilder Create(CodeTypeDeclaration decl, CodeTypeDeclItems declItems)
 {
     return(new DefaultPropertyBuilder(decl, declItems));
 }
示例#8
0
 public TypePropertyBuilder(CodeTypeDeclaration decl, CodeTypeDeclItems declItems)
 {
     this.decl      = decl;
     this.declItems = declItems;
 }
示例#9
0
 public SequencePropertyBuilder(GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems) : base(grouping, decl, declItems)
 {
 }
示例#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)
 {
 }
示例#16
0
 public static TypePropertyBuilder Create(CodeTypeDeclaration decl, CodeTypeDeclItems declItems) {
     return new DefaultPropertyBuilder(decl, declItems);
 }
示例#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
 }
示例#19
0
 public ContentModelPropertyBuilder(GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems) : base(decl, declItems)
 {
     this.grouping = grouping;
 }
示例#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);
        }
示例#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>();
     }
 }
示例#22
0
 public SequencePropertyBuilder(GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems) : base(grouping, decl, declItems) {
 }
示例#23
0
 internal DefaultPropertyBuilder(CodeTypeDeclaration decl, CodeTypeDeclItems declItems) : base(decl, declItems)
 {
 }
示例#24
0
 public TypePropertyBuilder(CodeTypeDeclaration decl, CodeTypeDeclItems declItems) {
     this.decl = decl;
     this.declItems = declItems;
 }
示例#25
0
 public ContentModelPropertyBuilder(GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems) : base(decl, declItems)
 {
     this.grouping = grouping; //The grouping the contentmodelbuilder works on
 }
示例#26
0
 public SequencePropertyBuilder(GroupingInfo grouping, CodeTypeDeclaration decl, CodeTypeDeclItems declItems,
                                GeneratedTypesVisibility visibility = GeneratedTypesVisibility.Public) :
     base(grouping, decl, declItems, visibility)
 {
 }