Esempio n. 1
0
        /// <summary>
        /// Creates a new instance of <see cref="Choice"/>.
        /// </summary>
        /// <param name="container">The <see cref="Choices"/> object to which this <see cref="Choice"/>
        ///  object belongs.</param>
        /// <param name="elem">The <see cref="Element"/> to which this <see cref="Choice"/> belongs.</param>
        ///  <param name="minOccurs">The "minOccurs" value for this <see cref="Choice"/>.</param>
        ///  <param name="maxOccurs">The "maxOccurs" value for this <see cref="Choice"/>.</param>
        public Choice(Choices container, Element elem, int minOccurs, int maxOccurs)
        {
            MyElement = elem;
            MinOccurances = minOccurs;
            MaxOccurances = maxOccurs;

            ParentContainer = container;

            //container.TheChoices.Add( this );

            MyElement.IsChoice = true;
            MyElement.UseChoiceIcon = true;
        }
Esempio n. 2
0
        private Element(Element e, bool UseClone)
        {
            this.id = e.id;
            this.prefix = e.prefix;
            this.nameWithNSPrefix = e.nameWithNSPrefix;
            this.name = e.name;
            this.type = e.type;
            this.origElementType = e.origElementType;
            this.substGroup = e.substGroup;
            this.attributeType = e.attributeType;
            this.isNull = e.isNull;
            this.tuple = e.tuple;
            this.nillable = e.nillable;
            this.perType = e.perType;
            this.balType = e.balType;
            this.abst = e.abst;
            this.typedDimensionId = e.typedDimensionId;

            //this.tupleChildren = e.tupleChildren;

            // need to do a deep copy - the IM taxonomy on .NET 2.0 children are pointing to the wrong parent
            // this didn't seem to make a difference, but I think it's a good thing, so I'm going to leave it in
            if (UseClone)
            {
                if (e.tupleChildren != null)
                {
                    tupleChildren = new SortedList();
                    IDictionaryEnumerator enumer = e.tupleChildren.GetEnumerator();

                    while (enumer.MoveNext())
                    {
                        this.AddChild((double)enumer.Key, (Element)((Element)enumer.Value).Clone());
                    }
                }

                if (e.tupleParentList != null)
                {
                    tupleParentList = new List<Element>();
                    foreach( Element tp in e.tupleParentList )
                    {
                        if (tp.id == this.id)
                        {
                            tupleParentList.Add(this);
                        }
                        else
                        {
                            tupleParentList.Add(tp.Clone() as Element);
                        }
                    }
                }

            }
            else
            {
                this.tupleChildren = e.tupleChildren;
                this.tupleParentList = e.tupleParentList;
            }
            this.labelInfo = e.labelInfo;
            this.referenceInfo = e.referenceInfo;
            this.taxonomyInfoId = e.taxonomyInfoId;
            this.markupValues = e.markupValues;
            this.EnumData = e.EnumData;
            this.IsAucentExtendedElement = e.IsAucentExtendedElement;
            this.HasCompleteTupleFamily = e.HasCompleteTupleFamily;

            this.isChoice = e.isChoice;
            this.UseChoiceIcon = e.UseChoiceIcon;
            this.ChoiceContainer = e.ChoiceContainer;
            this.childrenInfo = e.childrenInfo;
        }