System.ComponentModel.PropertyDescriptorCollection.this C# (CSharp) Метод

this() приватный Метод

private this ( object key ) : objectIDictionary.System.Diagnostics.CodeAnalysis
key object
Результат objectIDictionary.System.Diagnostics.CodeAnalysis
        object IDictionary.this[object key] {
            get {
                if (key is string) {
                    return this[(string)key];
                }
                return null;
            }

            set {
                if (readOnly) {
                    throw new NotSupportedException();
                }

                if (value != null && !(value is PropertyDescriptor)) {
                    throw new ArgumentException("value");
                }

                int index = -1;

                if (key is int) {
                    index = (int)key;

                    if (index < 0 || index >= propCount) {
                        throw new IndexOutOfRangeException();
                    }
                }
                else if (key is string) {
                    for (int i = 0; i < propCount; i++) {
                        if (properties[i].Name.Equals((string)key)) {
                            index = i;
                            break;
                        }
                    }
                }
                else {
                    throw new ArgumentException("key");
                }

                if (index == -1) {
                    Add((PropertyDescriptor)value);
                }
                else {
                    EnsurePropsOwned();
                    properties[index] = (PropertyDescriptor)value;
                    if (cachedFoundProperties != null && key is string) {
                        cachedFoundProperties[key] = value;
                    }
                }
            }
        }

Same methods

PropertyDescriptorCollection::this ( int index ) : PropertyDescriptor
PropertyDescriptorCollection::this ( string name ) : PropertyDescriptor
PropertyDescriptorCollection::this ( int index ) : objectIList.System.Diagnostics.CodeAnalysis