Files
Dec2017-Script-Dump/System/ComponentModel/PropertyDescriptorCollection.cs
T
2026-06-04 11:42:34 +02:00

649 lines
27 KiB
C#

using System;
using System.Collections;
namespace System.ComponentModel
{
/// <summary>Represents a collection of <see cref="T:System.ComponentModel.PropertyDescriptor" /> objects.</summary>
// Token: 0x020000B6 RID: 182
public class PropertyDescriptorCollection : ICollection, IDictionary, IEnumerable, IList
{
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> class.</summary>
/// <param name="properties">An array of type <see cref="T:System.ComponentModel.PropertyDescriptor" /> that provides the properties for this collection. </param>
// Token: 0x060005F0 RID: 1520 RVA: 0x0000F54C File Offset: 0x0000D74C
public PropertyDescriptorCollection(PropertyDescriptor[] properties)
{
this.properties = new ArrayList();
if (properties == null)
{
return;
}
this.properties.AddRange(properties);
}
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> class, which is optionally read-only.</summary>
/// <param name="properties">An array of type <see cref="T:System.ComponentModel.PropertyDescriptor" /> that provides the properties for this collection.</param>
/// <param name="readOnly">If true, specifies that the collection cannot be modified.</param>
// Token: 0x060005F1 RID: 1521 RVA: 0x0000F580 File Offset: 0x0000D780
public PropertyDescriptorCollection(PropertyDescriptor[] properties, bool readOnly)
: this(properties)
{
this.readOnly = readOnly;
}
// Token: 0x060005F2 RID: 1522 RVA: 0x0000F590 File Offset: 0x0000D790
private PropertyDescriptorCollection()
{
}
/// <summary>Adds an item to the <see cref="T:System.Collections.IList" />.</summary>
/// <returns>The position into which the new element was inserted.</returns>
/// <param name="value">The item to add to the collection.</param>
// Token: 0x060005F4 RID: 1524 RVA: 0x0000F5A8 File Offset: 0x0000D7A8
int IList.Add(object value)
{
return this.Add((PropertyDescriptor)value);
}
/// <summary>Adds an element with the provided key and value to the <see cref="T:System.Collections.IDictionary" />.</summary>
/// <param name="key">The <see cref="T:System.Object" /> to use as the key of the element to add.</param>
/// <param name="value">The <see cref="T:System.Object" /> to use as the value of the element to add.</param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="value" /> is null.</exception>
// Token: 0x060005F5 RID: 1525 RVA: 0x0000F5B8 File Offset: 0x0000D7B8
void IDictionary.Add(object key, object value)
{
if (!(value is PropertyDescriptor))
{
throw new ArgumentException("value");
}
this.Add((PropertyDescriptor)value);
}
/// <summary>Removes all items from the collection.</summary>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
// Token: 0x060005F6 RID: 1526 RVA: 0x0000F5E0 File Offset: 0x0000D7E0
void IList.Clear()
{
this.Clear();
}
/// <summary>Removes all elements from the <see cref="T:System.Collections.IDictionary" />. </summary>
// Token: 0x060005F7 RID: 1527 RVA: 0x0000F5E8 File Offset: 0x0000D7E8
void IDictionary.Clear()
{
this.Clear();
}
/// <summary>Determines whether the collection contains a specific value.</summary>
/// <returns>true if the item is found in the collection; otherwise, false.</returns>
/// <param name="value">The item to locate in the collection.</param>
// Token: 0x060005F8 RID: 1528 RVA: 0x0000F5F0 File Offset: 0x0000D7F0
bool IList.Contains(object value)
{
return this.Contains((PropertyDescriptor)value);
}
/// <summary>Determines whether the <see cref="T:System.Collections.IDictionary" /> contains an element with the specified key.</summary>
/// <returns>true if the <see cref="T:System.Collections.IDictionary" /> contains an element with the key; otherwise, false.</returns>
/// <param name="key">The key to locate in the <see cref="T:System.Collections.IDictionary" />.</param>
// Token: 0x060005F9 RID: 1529 RVA: 0x0000F600 File Offset: 0x0000D800
bool IDictionary.Contains(object value)
{
return this.Contains((PropertyDescriptor)value);
}
/// <summary>Returns an <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:System.Collections.IDictionary" />. </summary>
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:System.Collections.IDictionary" />.</returns>
// Token: 0x060005FA RID: 1530 RVA: 0x0000F610 File Offset: 0x0000D810
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
/// <summary>Returns an enumerator for this class.</summary>
/// <returns>An enumerator of type <see cref="T:System.Collections.IEnumerator" />.</returns>
// Token: 0x060005FB RID: 1531 RVA: 0x0000F618 File Offset: 0x0000D818
[global::System.MonoTODO]
IDictionaryEnumerator IDictionary.GetEnumerator()
{
throw new NotImplementedException();
}
/// <summary>Determines the index of a specified item in the collection.</summary>
/// <returns>The index of <paramref name="value" /> if found in the list, otherwise -1.</returns>
/// <param name="value">The item to locate in the collection.</param>
// Token: 0x060005FC RID: 1532 RVA: 0x0000F620 File Offset: 0x0000D820
int IList.IndexOf(object value)
{
return this.IndexOf((PropertyDescriptor)value);
}
/// <summary>Inserts an item into the collection at a specified index.</summary>
/// <param name="index">The zero-based index at which <paramref name="value" /> should be inserted.</param>
/// <param name="value">The item to insert into the collection.</param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
// Token: 0x060005FD RID: 1533 RVA: 0x0000F630 File Offset: 0x0000D830
void IList.Insert(int index, object value)
{
this.Insert(index, (PropertyDescriptor)value);
}
/// <summary>Removes the element with the specified key from the <see cref="T:System.Collections.IDictionary" />. </summary>
/// <param name="key">The key of the element to remove.</param>
// Token: 0x060005FE RID: 1534 RVA: 0x0000F640 File Offset: 0x0000D840
void IDictionary.Remove(object value)
{
this.Remove((PropertyDescriptor)value);
}
/// <summary>Removes the first occurrence of a specified value from the collection.</summary>
/// <param name="value">The item to remove from the collection.</param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
// Token: 0x060005FF RID: 1535 RVA: 0x0000F650 File Offset: 0x0000D850
void IList.Remove(object value)
{
this.Remove((PropertyDescriptor)value);
}
/// <summary>Removes the item at the specified index.</summary>
/// <param name="index">The zero-based index of the item to remove.</param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
// Token: 0x06000600 RID: 1536 RVA: 0x0000F660 File Offset: 0x0000D860
void IList.RemoveAt(int index)
{
this.RemoveAt(index);
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.IDictionary" /> has a fixed size.</summary>
/// <returns>true if the <see cref="T:System.Collections.IDictionary" /> has a fixed size; otherwise, false.</returns>
// Token: 0x1700018D RID: 397
// (get) Token: 0x06000601 RID: 1537 RVA: 0x0000F66C File Offset: 0x0000D86C
bool IDictionary.IsFixedSize
{
get
{
return ((IList)this).IsFixedSize;
}
}
/// <summary>Gets a value indicating whether the collection has a fixed size.</summary>
/// <returns>true if the collection has a fixed size; otherwise, false.</returns>
// Token: 0x1700018E RID: 398
// (get) Token: 0x06000602 RID: 1538 RVA: 0x0000F674 File Offset: 0x0000D874
bool IList.IsFixedSize
{
get
{
return this.readOnly;
}
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Collections.IDictionary" /> is read-only.</summary>
/// <returns>true if the <see cref="T:System.Collections.IDictionary" /> is read-only; otherwise, false.</returns>
// Token: 0x1700018F RID: 399
// (get) Token: 0x06000603 RID: 1539 RVA: 0x0000F67C File Offset: 0x0000D87C
bool IDictionary.IsReadOnly
{
get
{
return ((IList)this).IsReadOnly;
}
}
/// <summary>Gets a value indicating whether the collection is read-only.</summary>
/// <returns>true if the collection is read-only; otherwise, false.</returns>
// Token: 0x17000190 RID: 400
// (get) Token: 0x06000604 RID: 1540 RVA: 0x0000F684 File Offset: 0x0000D884
bool IList.IsReadOnly
{
get
{
return this.readOnly;
}
}
/// <summary>Gets a value indicating whether access to the collection is synchronized (thread safe).</summary>
/// <returns>true if access to the collection is synchronized (thread safe); otherwise, false.</returns>
// Token: 0x17000191 RID: 401
// (get) Token: 0x06000605 RID: 1541 RVA: 0x0000F68C File Offset: 0x0000D88C
bool ICollection.IsSynchronized
{
get
{
return false;
}
}
/// <summary>Gets the number of elements contained in the collection.</summary>
/// <returns>The number of elements contained in the collection.</returns>
// Token: 0x17000192 RID: 402
// (get) Token: 0x06000606 RID: 1542 RVA: 0x0000F690 File Offset: 0x0000D890
int ICollection.Count
{
get
{
return this.Count;
}
}
/// <summary>Gets an object that can be used to synchronize access to the collection.</summary>
/// <returns>An object that can be used to synchronize access to the collection.</returns>
// Token: 0x17000193 RID: 403
// (get) Token: 0x06000607 RID: 1543 RVA: 0x0000F698 File Offset: 0x0000D898
object ICollection.SyncRoot
{
get
{
return null;
}
}
/// <summary>Gets an <see cref="T:System.Collections.ICollection" /> containing the keys of the <see cref="T:System.Collections.IDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> containing the keys of the <see cref="T:System.Collections.IDictionary" />.</returns>
// Token: 0x17000194 RID: 404
// (get) Token: 0x06000608 RID: 1544 RVA: 0x0000F69C File Offset: 0x0000D89C
ICollection IDictionary.Keys
{
get
{
string[] array = new string[this.properties.Count];
int num = 0;
foreach (object obj in this.properties)
{
PropertyDescriptor propertyDescriptor = (PropertyDescriptor)obj;
array[num++] = propertyDescriptor.Name;
}
return array;
}
}
/// <summary>Gets an <see cref="T:System.Collections.ICollection" /> containing the values in the <see cref="T:System.Collections.IDictionary" />.</summary>
/// <returns>An <see cref="T:System.Collections.ICollection" /> containing the values in the <see cref="T:System.Collections.IDictionary" />.</returns>
// Token: 0x17000195 RID: 405
// (get) Token: 0x06000609 RID: 1545 RVA: 0x0000F728 File Offset: 0x0000D928
ICollection IDictionary.Values
{
get
{
return (ICollection)this.properties.Clone();
}
}
/// <summary>Gets or sets the element with the specified key. </summary>
/// <returns>The element with the specified key.</returns>
/// <param name="key">The key of the element to get or set. </param>
// Token: 0x17000196 RID: 406
object IDictionary.this[object key]
{
get
{
if (!(key is string))
{
return null;
}
return this[(string)key];
}
set
{
if (this.readOnly)
{
throw new NotSupportedException();
}
if (!(key is string) || !(value is PropertyDescriptor))
{
throw new ArgumentException();
}
int num = this.properties.IndexOf(value);
if (num == -1)
{
this.Add((PropertyDescriptor)value);
}
else
{
this.properties[num] = value;
}
}
}
/// <summary>Gets or sets an item from the collection at a specified index.</summary>
/// <returns>The element at the specified index.</returns>
/// <param name="index">The zero-based index of the item to get or set.</param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="value" /> is not a <see cref="T:System.ComponentModel.PropertyDescriptor" />.</exception>
/// <exception cref="T:System.IndexOutOfRangeException">
/// <paramref name="index" /> is less than 0. -or-<paramref name="index" /> is equal to or greater than <see cref="P:System.ComponentModel.EventDescriptorCollection.Count" />.</exception>
// Token: 0x17000197 RID: 407
object IList.this[int index]
{
get
{
return this.properties[index];
}
set
{
if (this.readOnly)
{
throw new NotSupportedException();
}
this.properties[index] = value;
}
}
/// <summary>Adds the specified <see cref="T:System.ComponentModel.PropertyDescriptor" /> to the collection.</summary>
/// <returns>The index of the <see cref="T:System.ComponentModel.PropertyDescriptor" /> that was added to the collection.</returns>
/// <param name="value">The <see cref="T:System.ComponentModel.PropertyDescriptor" /> to add to the collection. </param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
// Token: 0x0600060E RID: 1550 RVA: 0x0000F7F8 File Offset: 0x0000D9F8
public int Add(PropertyDescriptor value)
{
if (this.readOnly)
{
throw new NotSupportedException();
}
this.properties.Add(value);
return this.properties.Count - 1;
}
/// <summary>Removes all <see cref="T:System.ComponentModel.PropertyDescriptor" /> objects from the collection.</summary>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
// Token: 0x0600060F RID: 1551 RVA: 0x0000F828 File Offset: 0x0000DA28
public void Clear()
{
if (this.readOnly)
{
throw new NotSupportedException();
}
this.properties.Clear();
}
/// <summary>Returns whether the collection contains the given <see cref="T:System.ComponentModel.PropertyDescriptor" />.</summary>
/// <returns>true if the collection contains the given <see cref="T:System.ComponentModel.PropertyDescriptor" />; otherwise, false.</returns>
/// <param name="value">The <see cref="T:System.ComponentModel.PropertyDescriptor" /> to find in the collection. </param>
// Token: 0x06000610 RID: 1552 RVA: 0x0000F848 File Offset: 0x0000DA48
public bool Contains(PropertyDescriptor value)
{
return this.properties.Contains(value);
}
/// <summary>Copies the entire collection to an array, starting at the specified index number.</summary>
/// <param name="array">An array of <see cref="T:System.ComponentModel.PropertyDescriptor" /> objects to copy elements of the collection to. </param>
/// <param name="index">The index of the <paramref name="array" /> parameter at which copying begins. </param>
// Token: 0x06000611 RID: 1553 RVA: 0x0000F858 File Offset: 0x0000DA58
public void CopyTo(Array array, int index)
{
this.properties.CopyTo(array, index);
}
/// <summary>Returns the <see cref="T:System.ComponentModel.PropertyDescriptor" /> with the specified name, using a Boolean to indicate whether to ignore case.</summary>
/// <returns>A <see cref="T:System.ComponentModel.PropertyDescriptor" /> with the specified name, or null if the property does not exist.</returns>
/// <param name="name">The name of the <see cref="T:System.ComponentModel.PropertyDescriptor" /> to return from the collection. </param>
/// <param name="ignoreCase">true if you want to ignore the case of the property name; otherwise, false. </param>
// Token: 0x06000612 RID: 1554 RVA: 0x0000F868 File Offset: 0x0000DA68
public virtual PropertyDescriptor Find(string name, bool ignoreCase)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
for (int i = 0; i < this.properties.Count; i++)
{
PropertyDescriptor propertyDescriptor = (PropertyDescriptor)this.properties[i];
if (ignoreCase)
{
if (string.Compare(name, propertyDescriptor.Name, StringComparison.OrdinalIgnoreCase) == 0)
{
return propertyDescriptor;
}
}
else if (string.Compare(name, propertyDescriptor.Name, StringComparison.Ordinal) == 0)
{
return propertyDescriptor;
}
}
return null;
}
/// <summary>Returns an enumerator for this class.</summary>
/// <returns>An enumerator of type <see cref="T:System.Collections.IEnumerator" />.</returns>
// Token: 0x06000613 RID: 1555 RVA: 0x0000F8E8 File Offset: 0x0000DAE8
public virtual IEnumerator GetEnumerator()
{
return this.properties.GetEnumerator();
}
/// <summary>Returns the index of the given <see cref="T:System.ComponentModel.PropertyDescriptor" />.</summary>
/// <returns>The index of the given <see cref="T:System.ComponentModel.PropertyDescriptor" />.</returns>
/// <param name="value">The <see cref="T:System.ComponentModel.PropertyDescriptor" /> to return the index of. </param>
// Token: 0x06000614 RID: 1556 RVA: 0x0000F8F8 File Offset: 0x0000DAF8
public int IndexOf(PropertyDescriptor value)
{
return this.properties.IndexOf(value);
}
/// <summary>Adds the <see cref="T:System.ComponentModel.PropertyDescriptor" /> to the collection at the specified index number.</summary>
/// <param name="index">The index at which to add the <paramref name="value" /> parameter to the collection. </param>
/// <param name="value">The <see cref="T:System.ComponentModel.PropertyDescriptor" /> to add to the collection. </param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
// Token: 0x06000615 RID: 1557 RVA: 0x0000F908 File Offset: 0x0000DB08
public void Insert(int index, PropertyDescriptor value)
{
if (this.readOnly)
{
throw new NotSupportedException();
}
this.properties.Insert(index, value);
}
/// <summary>Removes the specified <see cref="T:System.ComponentModel.PropertyDescriptor" /> from the collection.</summary>
/// <param name="value">The <see cref="T:System.ComponentModel.PropertyDescriptor" /> to remove from the collection. </param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
// Token: 0x06000616 RID: 1558 RVA: 0x0000F928 File Offset: 0x0000DB28
public void Remove(PropertyDescriptor value)
{
if (this.readOnly)
{
throw new NotSupportedException();
}
this.properties.Remove(value);
}
/// <summary>Removes the <see cref="T:System.ComponentModel.PropertyDescriptor" /> at the specified index from the collection.</summary>
/// <param name="index">The index of the <see cref="T:System.ComponentModel.PropertyDescriptor" /> to remove from the collection. </param>
/// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
// Token: 0x06000617 RID: 1559 RVA: 0x0000F948 File Offset: 0x0000DB48
public void RemoveAt(int index)
{
if (this.readOnly)
{
throw new NotSupportedException();
}
this.properties.RemoveAt(index);
}
// Token: 0x06000618 RID: 1560 RVA: 0x0000F968 File Offset: 0x0000DB68
private PropertyDescriptorCollection CloneCollection()
{
return new PropertyDescriptorCollection
{
properties = (ArrayList)this.properties.Clone()
};
}
/// <summary>Sorts the members of this collection, using the default sort for this collection, which is usually alphabetical.</summary>
/// <returns>A new <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> that contains the sorted <see cref="T:System.ComponentModel.PropertyDescriptor" /> objects.</returns>
// Token: 0x06000619 RID: 1561 RVA: 0x0000F994 File Offset: 0x0000DB94
public virtual PropertyDescriptorCollection Sort()
{
PropertyDescriptorCollection propertyDescriptorCollection = this.CloneCollection();
propertyDescriptorCollection.InternalSort(null);
return propertyDescriptorCollection;
}
/// <summary>Sorts the members of this collection, using the specified <see cref="T:System.Collections.IComparer" />.</summary>
/// <returns>A new <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> that contains the sorted <see cref="T:System.ComponentModel.PropertyDescriptor" /> objects.</returns>
/// <param name="comparer">A comparer to use to sort the <see cref="T:System.ComponentModel.PropertyDescriptor" /> objects in this collection. </param>
// Token: 0x0600061A RID: 1562 RVA: 0x0000F9B0 File Offset: 0x0000DBB0
public virtual PropertyDescriptorCollection Sort(IComparer comparer)
{
PropertyDescriptorCollection propertyDescriptorCollection = this.CloneCollection();
propertyDescriptorCollection.InternalSort(comparer);
return propertyDescriptorCollection;
}
/// <summary>Sorts the members of this collection. The specified order is applied first, followed by the default sort for this collection, which is usually alphabetical.</summary>
/// <returns>A new <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> that contains the sorted <see cref="T:System.ComponentModel.PropertyDescriptor" /> objects.</returns>
/// <param name="names">An array of strings describing the order in which to sort the <see cref="T:System.ComponentModel.PropertyDescriptor" /> objects in this collection. </param>
// Token: 0x0600061B RID: 1563 RVA: 0x0000F9CC File Offset: 0x0000DBCC
public virtual PropertyDescriptorCollection Sort(string[] order)
{
PropertyDescriptorCollection propertyDescriptorCollection = this.CloneCollection();
propertyDescriptorCollection.InternalSort(order);
return propertyDescriptorCollection;
}
/// <summary>Sorts the members of this collection. The specified order is applied first, followed by the sort using the specified <see cref="T:System.Collections.IComparer" />.</summary>
/// <returns>A new <see cref="T:System.ComponentModel.PropertyDescriptorCollection" /> that contains the sorted <see cref="T:System.ComponentModel.PropertyDescriptor" /> objects.</returns>
/// <param name="names">An array of strings describing the order in which to sort the <see cref="T:System.ComponentModel.PropertyDescriptor" /> objects in this collection. </param>
/// <param name="comparer">A comparer to use to sort the <see cref="T:System.ComponentModel.PropertyDescriptor" /> objects in this collection. </param>
// Token: 0x0600061C RID: 1564 RVA: 0x0000F9E8 File Offset: 0x0000DBE8
public virtual PropertyDescriptorCollection Sort(string[] order, IComparer comparer)
{
PropertyDescriptorCollection propertyDescriptorCollection = this.CloneCollection();
if (order != null)
{
ArrayList arrayList = propertyDescriptorCollection.ExtractItems(order);
propertyDescriptorCollection.InternalSort(comparer);
arrayList.AddRange(propertyDescriptorCollection.properties);
propertyDescriptorCollection.properties = arrayList;
}
else
{
propertyDescriptorCollection.InternalSort(comparer);
}
return propertyDescriptorCollection;
}
/// <summary>Sorts the members of this collection, using the specified <see cref="T:System.Collections.IComparer" />.</summary>
/// <param name="sorter">A comparer to use to sort the <see cref="T:System.ComponentModel.PropertyDescriptor" /> objects in this collection. </param>
// Token: 0x0600061D RID: 1565 RVA: 0x0000FA34 File Offset: 0x0000DC34
protected void InternalSort(IComparer ic)
{
if (ic == null)
{
ic = MemberDescriptor.DefaultComparer;
}
this.properties.Sort(ic);
}
/// <summary>Sorts the members of this collection. The specified order is applied first, followed by the default sort for this collection, which is usually alphabetical.</summary>
/// <param name="names">An array of strings describing the order in which to sort the <see cref="T:System.ComponentModel.PropertyDescriptor" /> objects in this collection. </param>
// Token: 0x0600061E RID: 1566 RVA: 0x0000FA50 File Offset: 0x0000DC50
protected void InternalSort(string[] order)
{
if (order != null)
{
ArrayList arrayList = this.ExtractItems(order);
this.InternalSort(null);
arrayList.AddRange(this.properties);
this.properties = arrayList;
}
else
{
this.InternalSort(null);
}
}
// Token: 0x0600061F RID: 1567 RVA: 0x0000FA94 File Offset: 0x0000DC94
private ArrayList ExtractItems(string[] names)
{
ArrayList arrayList = new ArrayList(this.properties.Count);
object[] array = new object[names.Length];
for (int i = 0; i < this.properties.Count; i++)
{
PropertyDescriptor propertyDescriptor = (PropertyDescriptor)this.properties[i];
int num = Array.IndexOf<string>(names, propertyDescriptor.Name);
if (num != -1)
{
array[num] = propertyDescriptor;
this.properties.RemoveAt(i);
i--;
}
}
foreach (object obj in array)
{
if (obj != null)
{
arrayList.Add(obj);
}
}
return arrayList;
}
// Token: 0x06000620 RID: 1568 RVA: 0x0000FB48 File Offset: 0x0000DD48
internal PropertyDescriptorCollection Filter(Attribute[] attributes)
{
ArrayList arrayList = new ArrayList();
foreach (object obj in this.properties)
{
PropertyDescriptor propertyDescriptor = (PropertyDescriptor)obj;
if (propertyDescriptor.Attributes.Contains(attributes))
{
arrayList.Add(propertyDescriptor);
}
}
PropertyDescriptor[] array = new PropertyDescriptor[arrayList.Count];
arrayList.CopyTo(array);
return new PropertyDescriptorCollection(array, true);
}
/// <summary>Gets the number of property descriptors in the collection.</summary>
/// <returns>The number of property descriptors in the collection.</returns>
// Token: 0x17000198 RID: 408
// (get) Token: 0x06000621 RID: 1569 RVA: 0x0000FBEC File Offset: 0x0000DDEC
public int Count
{
get
{
return this.properties.Count;
}
}
/// <summary>Gets or sets the <see cref="T:System.ComponentModel.PropertyDescriptor" /> with the specified name.</summary>
/// <returns>The <see cref="T:System.ComponentModel.PropertyDescriptor" /> with the specified name, or null if the property does not exist.</returns>
/// <param name="name">The name of the <see cref="T:System.ComponentModel.PropertyDescriptor" /> to get from the collection. </param>
// Token: 0x17000199 RID: 409
public virtual PropertyDescriptor this[string s]
{
get
{
return this.Find(s, false);
}
}
/// <summary>Gets or sets the <see cref="T:System.ComponentModel.PropertyDescriptor" /> at the specified index number.</summary>
/// <returns>The <see cref="T:System.ComponentModel.PropertyDescriptor" /> with the specified index number.</returns>
/// <param name="index">The zero-based index of the <see cref="T:System.ComponentModel.PropertyDescriptor" /> to get or set. </param>
/// <exception cref="T:System.IndexOutOfRangeException">The <paramref name="index" /> parameter is not a valid index for <see cref="P:System.ComponentModel.PropertyDescriptorCollection.Item(System.Int32)" />. </exception>
// Token: 0x1700019A RID: 410
public virtual PropertyDescriptor this[int index]
{
get
{
return (PropertyDescriptor)this.properties[index];
}
}
/// <summary>Specifies an empty collection that you can use instead of creating a new one with no items. This static field is read-only.</summary>
// Token: 0x040001C0 RID: 448
public static readonly PropertyDescriptorCollection Empty = new PropertyDescriptorCollection(null, true);
// Token: 0x040001C1 RID: 449
private ArrayList properties;
// Token: 0x040001C2 RID: 450
private bool readOnly;
}
}