15 private int index = -1;
17 public object Current => Entry;
28 public object Key => owner[index].Name;
30 public object Value => owner[index].Name;
37 public bool MoveNext()
39 if (index < owner.
Count - 1)
58 private bool cachedIgnoreCase;
62 private int propCount;
64 private string[] namedSort;
68 private bool propsOwned =
true;
70 private bool needSort;
72 private bool readOnly;
86 if (index >= propCount)
91 return properties[index];
102 return Find(name, ignoreCase:
false);
168 return this[(string)key];
176 throw new NotSupportedException();
178 if (value !=
null && !(value is PropertyDescriptor))
180 throw new ArgumentException(
"value");
186 if (num < 0 || num >= propCount)
188 throw new IndexOutOfRangeException();
193 if (!(key is
string))
195 throw new ArgumentException(
"key");
197 for (
int i = 0; i < propCount; i++)
199 if (properties[i].Name.Equals((
string)key))
208 Add((PropertyDescriptor)value);
212 properties[num] = (PropertyDescriptor)value;
213 if (cachedFoundProperties !=
null && key is
string)
215 cachedFoundProperties[key] = value;
226 string[] array =
new string[propCount];
227 for (
int i = 0; i < propCount; i++)
229 array[i] = properties[i].
Name;
241 if (properties.Length != propCount)
243 PropertyDescriptor[] array =
new PropertyDescriptor[propCount];
244 Array.Copy(properties, 0, array, 0, propCount);
282 object IList.this[
int index]
292 throw new NotSupportedException();
294 if (index >= propCount)
296 throw new IndexOutOfRangeException();
298 if (value !=
null && !(value is PropertyDescriptor))
300 throw new ArgumentException(
"value");
303 properties[index] = (PropertyDescriptor)value;
311 this.properties = properties;
312 if (properties ==
null)
319 propCount = properties.Length;
330 this.readOnly = readOnly;
336 if (namedSort !=
null)
338 this.namedSort = (
string[])namedSort.Clone();
340 this.comparer = comparer;
341 this.properties = properties;
342 this.propCount = propCount;
356 EnsureSize(propCount + 1);
357 properties[propCount++] = value;
358 return propCount - 1;
370 cachedFoundProperties =
null;
391 private void EnsurePropsOwned()
396 if (properties !=
null)
400 properties = destinationArray;
410 private void EnsureSize(
int sizeNeeded)
412 if (sizeNeeded > properties.Length)
414 if (properties ==
null || properties.Length == 0)
417 properties =
new PropertyDescriptor[sizeNeeded];
421 int num = Math.Max(sizeNeeded, properties.Length * 2);
422 PropertyDescriptor[] destinationArray =
new PropertyDescriptor[num];
423 Array.Copy(properties, 0, destinationArray, 0, propCount);
424 properties = destinationArray;
438 if (cachedFoundProperties ==
null || cachedIgnoreCase != ignoreCase)
440 cachedIgnoreCase = ignoreCase;
443 object obj = cachedFoundProperties[name];
448 for (
int i = 0; i < propCount; i++)
452 if (
string.Equals(properties[i].Name, name,
StringComparison.OrdinalIgnoreCase))
454 cachedFoundProperties[name] = properties[i];
455 result = properties[i];
459 else if (properties[i].Name.Equals(name))
461 cachedFoundProperties[name] = properties[i];
462 result = properties[i];
475 return Array.IndexOf(properties, value, 0, propCount);
488 EnsureSize(propCount + 1);
489 if (index < propCount)
491 Array.
Copy(properties, index, properties, index + 1, propCount - index);
493 properties[index] = value;
522 if (index < propCount - 1)
524 Array.
Copy(properties, index + 1, properties, index, propCount - index - 1);
526 properties[propCount - 1] =
null;
566 if (properties ==
null || properties.Length == 0)
571 if (names ==
null || names.Length == 0)
577 int num2 = properties.Length;
578 for (
int i = 0; i < names.Length; i++)
580 for (
int j = 0; j < num2; j++)
583 if (propertyDescriptor !=
null && propertyDescriptor.
Name.Equals(names[i]))
585 properties[num++] = propertyDescriptor;
591 for (
int k = 0; k < num2; k++)
593 if (arrayList[k] !=
null)
619 if (properties.Length != propCount)
622 Array.
Copy(properties, 0, array, 0, propCount);
623 return array.GetEnumerator();
625 return properties.GetEnumerator();
637 if (propertyDescriptor ==
null)
641 Add(propertyDescriptor);
658 return this[(string)key] !=
null;
667 return new PropertyDescriptorEnumerator(
this);
676 PropertyDescriptor propertyDescriptor =
this[(string)key];
677 if (propertyDescriptor !=
null)
679 ((
IList)
this).Remove((
object)propertyDescriptor);
696 return Add((PropertyDescriptor)value);
712 return Contains((PropertyDescriptor)value);
720 return IndexOf((PropertyDescriptor)value);
729 Insert(index, (PropertyDescriptor)value);
737 Remove((PropertyDescriptor)value);
object SyncRoot
Gets an object that can be used to synchronize access to the T:System.Collections....
virtual IEnumerator GetEnumerator()
Returns an enumerator for this class.
static void SortDescriptorArray(IList infos)
Sorts descriptors using the name of the descriptor.
void Insert(int index, PropertyDescriptor value)
Adds the T:System.ComponentModel.PropertyDescriptor to the collection at the specified index number.
bool Contains(object key)
Determines whether the T:System.Collections.IDictionary object contains an element with the specified...
Much of the list has changed. Any listening controls should refresh all their data from the list.
StringComparison
Specifies the culture, case, and sort rules to be used by certain overloads of the M:System....
int Count
Gets the number of property descriptors in the collection.
Represents a non-generic collection of objects that can be individually accessed by index.
virtual PropertyDescriptor Find(string name, bool ignoreCase)
Returns the T:System.ComponentModel.PropertyDescriptor with the specified name, using a Boolean to in...
void RemoveAt(int index)
Removes the T:System.Collections.IList item at the specified index.
void Insert(int index, object value)
Inserts an item to the T:System.Collections.IList at the specified index.
bool IsReadOnly
Gets a value indicating whether the T:System.Collections.IList is read-only.
virtual PropertyDescriptorCollection Sort(IComparer comparer)
Sorts the members of this collection, using the specified T:System.Collections.IComparer.
void Clear()
Removes all items from the T:System.Collections.IList.
int IndexOf(object value)
Determines the index of a specific item in the T:System.Collections.IList.
void InternalSort(string[] names)
Sorts the members of this collection. The specified order is applied first, followed by the default s...
bool IsFixedSize
Gets a value indicating whether the T:System.Collections.IDictionary object has a fixed size.
void CopyTo(Array array, int index)
Copies the entire collection to an array, starting at the specified index number.
Provides an abstraction of a property on a class.
virtual PropertyDescriptorCollection Sort(string[] names, IComparer comparer)
Sorts the members of this collection. The specified order is applied first, followed by the sort usin...
bool IsFixedSize
Gets a value indicating whether the T:System.Collections.IList has a fixed size.
virtual string Name
Gets the name of the member.
Exposes an enumerator, which supports a simple iteration over a non-generic collection....
SecurityAction
Specifies the security actions that can be performed using declarative security.
static void Sort(Array array)
Sorts the elements in an entire one-dimensional T:System.Array using the T:System....
static readonly PropertyDescriptorCollection Empty
Specifies an empty collection that you can use instead of creating a new one with no items....
The exception that is thrown when an attempt is made to access an element of an array or collection w...
PropertyDescriptorCollection(PropertyDescriptor[] properties)
Initializes a new instance of the T:System.ComponentModel.PropertyDescriptorCollection class.
void Add(object key, object value)
Adds an element with the provided key and value to the T:System.Collections.IDictionary object.
void InternalSort(IComparer sorter)
Sorts the members of this collection, using the specified T:System.Collections.IComparer.
PropertyDescriptorCollection(PropertyDescriptor[] properties, bool readOnly)
Initializes a new instance of the T:System.ComponentModel.PropertyDescriptorCollection class,...
void Clear()
Removes all T:System.ComponentModel.PropertyDescriptor objects from the collection.
Exposes a method that compares two objects.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
bool IsSynchronized
Gets a value indicating whether access to the T:System.Collections.ICollection is synchronized (threa...
void Clear()
Removes all elements from the T:System.Collections.IDictionary object.
Provides information about the characteristics for a component, such as its attributes,...
void Remove(object key)
Removes the element with the specified key from the T:System.Collections.IDictionary object.
int Add(object value)
Adds an item to the T:System.Collections.IList.
IEnumerator GetEnumerator()
Returns an enumerator that iterates through a collection.
The exception that is thrown when one of the arguments provided to a method is not valid.
ICollection Keys
Gets an T:System.Collections.ICollection object containing the keys of the T:System....
ICollection Values
Gets an T:System.Collections.ICollection object containing the values in the T:System....
static void Copy(Array sourceArray, Array destinationArray, int length)
Copies a range of elements from an T:System.Array starting at the first element and pastes them into ...
Implements IDictionary by using a T:System.Collections.Specialized.ListDictionary while the collectio...
void Remove(PropertyDescriptor value)
Removes the specified T:System.ComponentModel.PropertyDescriptor from the collection.
new IDictionaryEnumerator GetEnumerator()
Returns an T:System.Collections.IDictionaryEnumerator object for the T:System.Collections....
bool IsReadOnly
Gets a value indicating whether the T:System.Collections.IDictionary object is read-only.
Represents a collection of T:System.ComponentModel.PropertyDescriptor objects.
int Add(PropertyDescriptor value)
Adds the specified T:System.ComponentModel.PropertyDescriptor to the collection.
Enumerates the elements of a nongeneric dictionary.
virtual PropertyDescriptorCollection Sort(string[] names)
Sorts the members of this collection. The specified order is applied first, followed by the default s...
void Remove(object value)
Removes the first occurrence of a specific object from the T:System.Collections.IList.
void RemoveAt(int index)
Removes the T:System.ComponentModel.PropertyDescriptor at the specified index from the collection.
bool Contains(object value)
Determines whether the T:System.Collections.IList contains a specific value.
virtual PropertyDescriptorCollection Sort()
Sorts the members of this collection, using the default sort for this collection, which is usually al...
int Count
Gets the number of elements contained in the T:System.Collections.ICollection.
The exception that is thrown when an invoked method is not supported, or when there is an attempt to ...
Defines size, enumerators, and synchronization methods for all nongeneric collections.
Defines a dictionary key/value pair that can be set or retrieved.
Represents a nongeneric collection of key/value pairs.
Supports a simple iteration over a non-generic collection.
bool Contains(PropertyDescriptor value)
Returns whether the collection contains the given T:System.ComponentModel.PropertyDescriptor.
Implements the T:System.Collections.IList interface using an array whose size is dynamically increase...
int IndexOf(PropertyDescriptor value)
Returns the index of the given T:System.ComponentModel.PropertyDescriptor.