9 [global::__DynamicallyInvokable]
12 private string[] _all;
14 private string[] _allKeys;
20 public string this[
string name]
22 [global::__DynamicallyInvokable]
27 [global::__DynamicallyInvokable]
39 public string this[
int index]
79 [Obsolete(
"Please use NameValueCollection(IEqualityComparer) instead.")]
81 : base(hashProvider, comparer)
97 : base(equalityComparer)
107 : base(capacity, equalityComparer)
125 base.Comparer = col.Comparer;
135 [Obsolete(
"Please use NameValueCollection(Int32, IEqualityComparer) instead.")]
137 : base(capacity, hashProvider, comparer)
150 : base(info, context)
161 private static string GetAsOneString(
ArrayList list)
163 int num = list?.Count ?? 0;
166 return (
string)list[0];
171 for (
int i = 1; i < num; i++)
173 stringBuilder.
Append(
',');
174 stringBuilder.
Append((
string)list[i]);
181 private static string[] GetAsStringArray(ArrayList list)
183 int num = list?.Count ?? 0;
188 string[] array =
new string[num];
189 list.CopyTo(0, array, 0, num);
206 for (
int i = 0; i < count; i++)
212 for (
int j = 0; j < values.Length; j++)
267 string[] array =
new string[count];
268 for (
int i = 0; i < count; i++)
277 for (
int j = 0; j < count; j++)
289 return InternalHasKeys();
292 internal virtual bool InternalHasKeys()
301 public virtual void Add(
string name,
string value)
309 if (arrayList ==
null)
314 arrayList.
Add(value);
318 else if (value !=
null)
320 arrayList.
Add(value);
327 public virtual string Get(
string name)
330 return GetAsOneString(list);
339 return GetAsStringArray(list);
346 public virtual void Set(
string name,
string value)
354 arrayList.
Add(value);
372 public virtual string Get(
int index)
375 return GetAsOneString(list);
386 return GetAsStringArray(list);
Supplies a hash code for an object, using a custom hash function.
virtual string [] GetValues(int index)
Gets the values at the specified index of the T:System.Collections.Specialized.NameValueCollection.
virtual string Get(string name)
Gets the values associated with the specified key from the T:System.Collections.Specialized....
Compares two objects for equivalence, where string comparisons are case-sensitive.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Represents a collection of associated T:System.String keys and T:System.String values that can be acc...
virtual void Clear()
Invalidates the cached arrays and removes all entries from the T:System.Collections....
unsafe override string ToString()
Converts the value of this instance to a T:System.String.
NameValueCollection(int capacity)
Initializes a new instance of the T:System.Collections.Specialized.NameValueCollection class that is ...
virtual void Add(string name, string value)
Adds an entry with the specified name and value to the T:System.Collections.Specialized....
bool HasKeys()
Gets a value indicating whether the T:System.Collections.Specialized.NameValueCollection contains key...
virtual string Get(int index)
Gets the values at the specified index of the T:System.Collections.Specialized.NameValueCollection co...
virtual string [] AllKeys
Gets all the keys in the T:System.Collections.Specialized.NameValueCollection.
virtual void Remove(string name)
Removes the entries with the specified key from the T:System.Collections.Specialized....
NameValueCollection(IEqualityComparer equalityComparer)
Initializes a new instance of the T:System.Collections.Specialized.NameValueCollection class that is ...
NameValueCollection(int capacity, IHashCodeProvider hashProvider, IComparer comparer)
Initializes a new instance of the T:System.Collections.Specialized.NameValueCollection class that is ...
The exception that is thrown when the value of an argument is outside the allowable range of values a...
Describes the source and destination of a given serialized stream, and provides an additional caller-...
int Rank
Gets the rank (number of dimensions) of the T:System.Array. For example, a one-dimensional array retu...
void BaseClear()
Removes all entries from the T:System.Collections.Specialized.NameObjectCollectionBase instance.
StringBuilder Append(char value, int repeatCount)
Appends a specified number of copies of the string representation of a Unicode character to this inst...
virtual string [] GetValues(string name)
Gets the values associated with the specified key from the T:System.Collections.Specialized....
NameValueCollection(SerializationInfo info, StreamingContext context)
Initializes a new instance of the T:System.Collections.Specialized.NameValueCollection class that is ...
string [] BaseGetAllKeys()
Returns a T:System.String array that contains all the keys in the T:System.Collections....
unsafe void SetValue(object value, int index)
Sets a value to the element at the specified position in the one-dimensional T:System....
Defines methods to support the comparison of objects for equality.
virtual string GetKey(int index)
Gets the key at the specified index of the T:System.Collections.Specialized.NameValueCollection.
virtual void Set(string name, string value)
Sets the value of an entry in the T:System.Collections.Specialized.NameValueCollection.
Exposes a method that compares two objects.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
string BaseGetKey(int index)
Gets the key of the entry at the specified index of the T:System.Collections.Specialized....
Provides the abstract base class for a collection of associated T:System.String keys and T:System....
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
Represents a mutable string of characters. This class cannot be inherited.To browse the ....
virtual int Add(object value)
Adds an object to the end of the T:System.Collections.ArrayList.
void CopyTo(Array dest, int index)
Copies the entire T:System.Collections.Specialized.NameValueCollection to a compatible one-dimensiona...
static CultureInfo CurrentCulture
Gets or sets the T:System.Globalization.CultureInfo object that represents the culture used by the cu...
The exception that is thrown when one of the arguments provided to a method is not valid.
NameValueCollection(IHashCodeProvider hashProvider, IComparer comparer)
Initializes a new instance of the T:System.Collections.Specialized.NameValueCollection class that is ...
void InvalidateCachedArrays()
Resets the cached arrays of the collection to null.
object BaseGet(string name)
Gets the value of the first entry with the specified key from the T:System.Collections....
int Length
Gets the total number of elements in all the dimensions of the T:System.Array.
Specifies that the class can be serialized.
virtual int Count
Gets the number of key/value pairs contained in the T:System.Collections.Specialized....
void BaseSet(string name, object value)
Sets the value of the first entry with the specified key in the T:System.Collections....
Provides information about a specific culture (called a locale for unmanaged code development)....
The exception that is thrown when an invoked method is not supported, or when there is an attempt to ...
void Add(NameValueCollection c)
Copies the entries in the specified T:System.Collections.Specialized.NameValueCollection to the curre...
bool BaseHasKeys()
Gets a value indicating whether the T:System.Collections.Specialized.NameObjectCollectionBase instanc...
void BaseRemove(string name)
Removes the entries with the specified key from the T:System.Collections.Specialized....
void BaseAdd(string name, object value)
Adds an entry with the specified key and value into the T:System.Collections.Specialized....
NameValueCollection()
Initializes a new instance of the T:System.Collections.Specialized.NameValueCollection class that is ...
Represents a nonexistent value. This class cannot be inherited.
Implements the T:System.Collections.IList interface using an array whose size is dynamically increase...
NameValueCollection(int capacity, IEqualityComparer equalityComparer)
Initializes a new instance of the T:System.Collections.Specialized.NameValueCollection class that is ...