Ejemplo n.º 1
0
        public AssociatedPropertyDef Clone()
        {
            TestAssociatedPropertyDef apd = new TestAssociatedPropertyDef
            {
                PropertyDef = this.PropertyDef,
                Required    = this.Required
            };

            return(apd);
        }
        public void Add(int index, AssociatedPropertyDef associatedPropertyDef)
        {
            TestAssociatedPropertyDef newState = (associatedPropertyDef as TestAssociatedPropertyDef) ?? new TestAssociatedPropertyDef(associatedPropertyDef);

            if (index == -1 || index == tapd.Count + 1)
            {
                tapd.Add(newState);
            }
            else if (index > tapd.Count)
            {
                throw new Exception("Index out of range: " + index);
            }
            else
            {
                // I hate 1 indexing
                tapd[index - 1] = newState;
            }
        }