Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Collections.​Specialized.​NameObjectCollectionBase

Assembly: System.Collections.Specialized

Inheritance: object → NameObjectCollectionBase

Implemented Interfaces

Provides the <see langword="abstract" /> base class for a collection of associated <see cref="T:System.String" /> keys and <see cref="T:System.Object" /> values that can be accessed either with the key or with the index.

Properties

public int
Count
Gets the number of key/value pairs contained in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
protected bool
IsReadOnly
Gets or sets a value indicating whether the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance is read-only.
Keys
Gets a <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" /> instance that contains all the keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.

Methods

protected void
BaseAdd​(string name, object value)
Adds an entry with the specified key and value into the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
name The <see cref="T:System.String" /> key of the entry to add. The key can be <see langword="null" /> .
value The <see cref="T:System.Object" /> value of the entry to add. The value can be <see langword="null" /> .
protected void
BaseClear​()
Removes all entries from the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
protected object
BaseGet​(int index)
Gets the value of the entry at the specified index of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
Returns An <see cref="T:System.Object" /> that represents the value of the entry at the specified index.
index The zero-based index of the value to get.
protected object
BaseGet​(string name)
Gets the value of the first entry with the specified key from the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
Returns An <see cref="T:System.Object" /> that represents the value of the first entry with the specified key, if found; otherwise, <see langword="null" /> .
name The <see cref="T:System.String" /> key of the entry to get. The key can be <see langword="null" /> .
protected string[]
BaseGetAllKeys​()
Returns a <see cref="T:System.String" /> array that contains all the keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
Returns A <see cref="T:System.String" /> array that contains all the keys in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
protected object[]
BaseGetAllValues​()
Returns an <see cref="T:System.Object" /> array that contains all the values in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
Returns An <see cref="T:System.Object" /> array that contains all the values in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
protected object[]
BaseGetAllValues​(Type type)
Returns an array of the specified type that contains all the values in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
Returns An array of the specified type that contains all the values in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
type A <see cref="T:System.Type" /> that represents the type of array to return.
protected string
BaseGetKey​(int index)
Gets the key of the entry at the specified index of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
Returns A <see cref="T:System.String" /> that represents the key of the entry at the specified index.
index The zero-based index of the key to get.
protected bool
BaseHasKeys​()
Gets a value indicating whether the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance contains entries whose keys are not <see langword="null" /> .
Returns <see langword="true" /> if the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance contains entries whose keys are not <see langword="null" /> ; otherwise, <see langword="false" /> .
protected void
BaseRemove​(string name)
Removes the entries with the specified key from the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
name The <see cref="T:System.String" /> key of the entries to remove. The key can be <see langword="null" /> .
protected void
BaseRemoveAt​(int index)
Removes the entry at the specified index of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
index The zero-based index of the entry to remove.
protected void
BaseSet​(int index, object value)
Sets the value of the entry at the specified index of the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
index The zero-based index of the entry to set.
value The <see cref="T:System.Object" /> that represents the new value of the entry to set. The value can be <see langword="null" /> .
protected void
BaseSet​(string name, object value)
Sets the value of the first entry with the specified key in the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance, if found; otherwise, adds an entry with the specified key and value into the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
name The <see cref="T:System.String" /> key of the entry to set. The key can be <see langword="null" /> .
value The <see cref="T:System.Object" /> that represents the new value of the entry to set. The value can be <see langword="null" /> .
public IEnumerator
GetEnumerator​()
Returns an enumerator that iterates through the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> .
Returns An <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
public void
GetObjectData​(Runtime.​Serialization.​SerializationInfo info, Runtime.​Serialization.​StreamingContext context)
Implements the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface and returns the data needed to serialize the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
info A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object that contains the information required to serialize the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
context A <see cref="T:System.Runtime.Serialization.StreamingContext" /> object that contains the source and destination of the serialized stream associated with the <see cref="T:System.Collections.Specialized.NameObjectCollectionBase" /> instance.
public void
OnDeserialization​(object sender)
Implements the <see cref="T:System.Runtime.Serialization.ISerializable" /> interface and raises the deserialization event when the deserialization is complete.
sender The source of the deserialization event.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object