public virtual IEnumerator GetEnumerator()
 {
     this.EnsurePropsOwned();
     if (this.properties.Length != this.propCount)
     {
         PropertyDescriptor[] destinationArray = new PropertyDescriptor[this.propCount];
         Array.Copy(this.properties, 0, destinationArray, 0, this.propCount);
         return(destinationArray.GetEnumerator());
     }
     return(this.properties.GetEnumerator());
 }
 /// <summary>
 /// Gets an enumerator for this <see cref='System.ComponentModel.PropertyDescriptorCollection'/>.
 /// </summary>
 public virtual IEnumerator GetEnumerator()
 {
     EnsurePropsOwned();
     // we can only return an enumerator on the props we actually have...
     if (_properties.Length != Count)
     {
         PropertyDescriptor[] enumProps = new PropertyDescriptor[Count];
         Array.Copy(_properties, enumProps, Count);
         return(enumProps.GetEnumerator());
     }
     return(_properties.GetEnumerator());
 }
コード例 #3
0
 /// <summary>
 ///    <para>
 ///       Gets an enumerator for this <see cref='System.ComponentModel.PropertyDescriptorCollection'/>.
 ///    </para>
 /// </summary>
 public virtual IEnumerator GetEnumerator()
 {
     EnsurePropsOwned();
     // we can only return an enumerator on the props we actually have...
     if (_properties.Length != Count)
     {
         PropertyDescriptor[] enumProps = new PropertyDescriptor[Count];
         Array.Copy(_properties, 0, enumProps, 0, Count);
         return enumProps.GetEnumerator();
     }
     return _properties.GetEnumerator();
 }
 public virtual IEnumerator GetEnumerator()
 {
     this.EnsurePropsOwned();
     if (this.properties.Length != this.propCount)
     {
         PropertyDescriptor[] destinationArray = new PropertyDescriptor[this.propCount];
         Array.Copy(this.properties, 0, destinationArray, 0, this.propCount);
         return destinationArray.GetEnumerator();
     }
     return this.properties.GetEnumerator();
 }