AddToConstructor() abstract private method

abstract private AddToConstructor ( CodeConstructor functionalConstructor ) : void
functionalConstructor System.CodeDom.CodeConstructor
return void
Ejemplo n.º 1
0
        public override void GenerateConstructorCode(ClrBasePropertyInfo property)
        {
            if (flatChoice && !hasDuplicateType && property.ContentType != ContentType.WildCardProperty)
            {
                ClrBasePropertyInfo prevProperty = null;
                string propertyReturnType        = property.ClrTypeName;
                if (propertyTypeNameTable.TryGetValue(propertyReturnType, out prevProperty))
                {
                    hasDuplicateType = true;
                    return;
                }
                else
                {
                    propertyTypeNameTable.Add(propertyReturnType, property);
                }
                if (choiceConstructors == null)
                {
                    choiceConstructors = new List <CodeConstructor>();
                }


                CodeConstructor choiceConstructor = CodeDomHelper.CreateConstructor(MemberAttributes.Public);
                property.AddToConstructor(choiceConstructor);
                choiceConstructors.Add(choiceConstructor);
            }
        }
Ejemplo n.º 2
0
        public override void GenerateConstructorCode(ClrBasePropertyInfo property)
        {
            if (flatChoice && !hasDuplicateType && property.ContentType != ContentType.WildCardProperty) {
                ClrBasePropertyInfo prevProperty = null;
                string propertyReturnType = property.ClrTypeName;
                if (propertyTypeNameTable.TryGetValue(propertyReturnType, out prevProperty)) {
                    hasDuplicateType = true;
                    return;
                }
                else {
                    propertyTypeNameTable.Add(propertyReturnType, property);
                }
                if (choiceConstructors == null) {
                    choiceConstructors = new List<CodeConstructor>();
                }

                CodeConstructor choiceConstructor = CodeDomHelper.CreateConstructor(MemberAttributes.Public);
                property.AddToConstructor(choiceConstructor);
                choiceConstructors.Add(choiceConstructor);

            }
        }