The NameValueCollection type exposes the following members.

Constructors

  NameDescription
Public methodNameValueCollection()()()()
Initializes a new instance of the NameValueCollection class that is empty and has the default initial capacity.
Public methodNameValueCollection(Int32)
Initializes a new instance of the NameValueCollection class that is empty and has the specified initial capacity.
Public methodNameValueCollection(NameValueCollection)
Initializes a new instance of the NameValueCollection class that contains elements copied from the specified collection and that has the same initial capacity as the number of elements copied.
Public methodNameValueCollection(array<NameValueEntry>[]()[][])
Initializes a new instance of the NameValueCollection class that contains elements copied from the specified NameValueEntry array and that has the same initial capacity as the number of elements copied.

Methods

  NameDescription
Public methodAdd(NameValueEntry)
Adds a NameValueEntry to the end of the NameValueCollection.
Public methodAdd(String, String)
Adds an element with the specified String key and String value to the end of the NameValueCollection.
Public methodAddRange(NameValueCollection)
Adds the elements of another collection to the end of the NameValueCollection.
Public methodAddRange(array<NameValueEntry>[]()[][])
Adds the elements of a NameValueEntry array to the end of the NameValueCollection.
Public methodClear
Removes all elements from the NameValueCollection.
Public methodClone
Creates a shallow copy of the NameValueCollection.
Public methodContains
Determines whether the NameValueCollection contains the specified NameValueEntry element.
Public methodContainsKey
Determines whether the NameValueCollection contains the specified String key.
Public methodContainsValue
Determines whether the NameValueCollection contains the specified String value.
Public methodCopyTo
Copies the entire NameValueCollection to a one-dimensional Array of NameValueEntry elements, starting at the specified index of the target array.
Public methodEquals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodEquals(NameValueCollection)
Determines whether the specified NameValueCollection is equal to the current NameValueCollection.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetByIndex
Gets the String value at the specified index of the NameValueCollection.
Public methodGetByKey
Gets the String value associated with the first occurrence of the specified String key.
Public methodGetEnumerator
Returns an IStringStringEnumerator that can iterate through the NameValueCollection.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetKey
Gets the String key at the specified index of the NameValueCollection.
Public methodGetKeyList
Gets the keys in the NameValueCollection.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetValueList
Gets the values in the NameValueCollection.
Public methodIndexOf
Returns the zero-based index of the first occurrence of the specified NameValueEntry in the NameValueCollection.
Public methodIndexOfKey
Returns the zero-based index of the first occurrence of the specified String key in the NameValueCollection.
Public methodIndexOfValue
Returns the zero-based index of first occurrence of the specified String value in the NameValueCollection.
Public methodInsert
Inserts a NameValueEntry element into the NameValueCollection at the specified index.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemove
Removes the first occurrence of the specified NameValueEntry from the NameValueCollection.
Public methodRemoveAt
Removes the element at the specified index of the NameValueCollection.
Public methodSetByIndex
Sets the String value at the specified index of the NameValueCollection.
Public methodSetByKey
Sets the String value associated with the first occurrence of the specified String key.
Public methodStatic memberSynchronized
Returns a synchronized (thread-safe) wrapper for the specified NameValueCollection.
Public methodToArray
Copies the elements of the NameValueCollection to a new Array of NameValueEntry elements.
Public methodToString (Overrides Object..::..ToString()()()().)
Public methodTrimToSize
Sets the capacity to the actual number of elements in the NameValueCollection.

Properties

  NameDescription
Public propertyCapacity
Gets or sets the capacity of the NameValueCollection.
Public propertyCount
Gets the number of key-and-value pairs contained in the NameValueCollection.
Protected propertyInnerKeys
Gets the list of keys contained in the NameValueCollection instance.
Protected propertyInnerValues
Gets the list of values contained in the NameValueCollection instance.
Public propertyIsFixedSize
Gets a value indicating whether the NameValueCollection has a fixed size.
Public propertyIsReadOnly
Gets a value indicating whether the NameValueCollection is read-only.
Public propertyIsSynchronized
Gets a value indicating whether access to the NameValueCollection is synchronized (thread-safe).
Public propertyItem
Gets or sets the NameValueEntry element at the specified index.
Public propertyKeys
Gets an IStringCollection containing the keys in the NameValueCollection.
Public propertySyncRoot
Gets an object that can be used to synchronize access to the NameValueCollection.
Public propertyValues
Gets an IStringCollection containing the values in the NameValueCollection.

See Also