private void Initialize(IEnumerable <Property> properties, IEnumerable <PropertyCollectionRule> rules)
 {
     using (IEnumerator <Property> enumerator = properties.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             Property property = enumerator.Current.Clone();
             this.properties.Add(property.Name, property);
         }
     }
     using (IEnumerator <PropertyCollectionRule> enumerator2 = rules.GetEnumerator())
     {
         while (enumerator2.MoveNext())
         {
             PropertyCollectionRule item = enumerator2.Current.Clone();
             this.rules.Add(item);
         }
     }
     using (List <PropertyCollectionRule> .Enumerator enumerator3 = this.rules.GetEnumerator())
     {
         while (enumerator3.MoveNext())
         {
             enumerator3.Current.Initialize(this);
         }
     }
     this.HookUpEvents();
 }
        public PropertyCollection Clone()
        {
            List <Property> clonedProperties = new List <Property>();

            foreach (Property property in this.Properties)
            {
                Property clonedProperty = property.Clone();
                clonedProperties.Add(clonedProperty);
            }

            List <PropertyCollectionRule> clonedRules = new List <PropertyCollectionRule>();

            foreach (PropertyCollectionRule rule in this.rules)
            {
                PropertyCollectionRule clonedRule = rule.Clone();
                clonedRules.Add(clonedRule);
            }

            return(new PropertyCollection(clonedProperties, clonedRules));
        }
        private void Initialize(
            IEnumerable <Property> properties,
            IEnumerable <PropertyCollectionRule> rules)
        {
            foreach (Property property in properties)
            {
                Property propertyClone = property.Clone();
                this.properties.Add(propertyClone.Name, propertyClone);
            }

            foreach (PropertyCollectionRule rule in rules)
            {
                PropertyCollectionRule ruleClone = rule.Clone();
                this.rules.Add(ruleClone);
            }

            foreach (PropertyCollectionRule rule in this.rules)
            {
                rule.Initialize(this);
            }

            HookUpEvents();
        }
        public PropertyCollection Clone()
        {
            List <Property> properties = new List <Property>();

            using (IEnumerator <Property> enumerator = this.Properties.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Property item = enumerator.Current.Clone();
                    properties.Add(item);
                }
            }
            List <PropertyCollectionRule> rules = new List <PropertyCollectionRule>();

            using (List <PropertyCollectionRule> .Enumerator enumerator2 = this.rules.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    PropertyCollectionRule rule = enumerator2.Current.Clone();
                    rules.Add(rule);
                }
            }
            return(new PropertyCollection(properties, rules));
        }