Class
StringKeyStoreCollection
Represents a collection of string keys associated with multiple string values.
public class StringKeyStoreCollection : IDictionary<string, string[]>, ICollection<KeyValuePair<string, string[]>>, IEnumerable<KeyValuePair<string, string[]>>, IEnumerableInheritance #
object ← StringKeyStoreCollection
Derived #
HttpHeaderCollection, StringValueCollection
Implements #
IDictionary<string, string[]>, ICollection<KeyValuePair<string, string[]>>, IEnumerable<KeyValuePair<string, string[]>>, IEnumerable
Inherited Members #
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors #
| Name | Description |
|---|---|
| StringKeyStoreCollection() | Initializes a new instance of the StringKeyStoreCollection class, |
| StringKeyStoreCollection(IEqualityComparer<string>) | Initializes a new instance of the StringKeyStoreCollection class with a specified comparer. |
| StringKeyStoreCollection(IEqualityComparer<string>, IDictionary<string, string[]>?) | Initializes a new instance of the StringKeyStoreCollection class, |
Properties #
| Name | Description |
|---|---|
| Comparer | Gets the IEqualityComparer used to compare keys in this StringKeyStoreCollection. |
| Count | Gets the number of key-value pairs in the StringKeyStoreCollection. |
| IsReadOnly | Gets a value indicating whether the StringKeyStoreCollection is read-only. |
| Keys | Gets the collection of keys in the StringKeyStoreCollection. |
| Values | Gets the collection of values in the StringKeyStoreCollection as arrays. Each key may have multiple associated values. |
| this[string] | Gets or sets the array of values associated with the specified key. Returns null if the key does not exist in the store. |
Methods #
| Name | Description |
|---|---|
| Add(string, string[]) | Adds an array of values associated with the specified key. |
| Add(string, IEnumerable<string>) | Adds a collection of values associated with the specified key. |
| Add(string, string) | Adds a single value associated with the specified key. |
| Add(KeyValuePair<string, string[]>) | Adds a key-value pair to the StringKeyStoreCollection. |
| AddRange(IEnumerable<KeyValuePair<string, string[]>>) | Adds the elements of the specified collection to the end of this collection. |
| AddRange(IEnumerable<KeyValuePair<string, string?>>) | Adds the elements of the specified collection to the end of this collection. |
| AsDictionary() | Copies the contents of this StringKeyStoreCollection into an Dictionary. |
| AsNameValueCollection() | Copies the contents of this StringKeyStoreCollection into an NameValueCollection, with values separated with an comma (,). |
| AsStringValueCollection() | Copies the contents of this StringKeyStoreCollection into an StringValueCollection. |
| Clear() | Removes all key-value pairs from the StringKeyStoreCollection. Throws an exception if the store is read-only. |
| ContainsKey(string) | Determines whether the StringKeyStoreCollection contains a specific key. |
| FromCookieString(string) | Creates a new instance of the StringKeyStoreCollection from a cookie string. The query string should be in the format of “key1=value1; key2=value2”. |
| FromNameValueCollection(NameValueCollection) | Creates a new instance of the StringKeyStoreCollection from a NameValueCollection. |
| FromQueryString(string) | Creates a new instance of the StringKeyStoreCollection from a query string. The query string should be in the format of “key1=value1&key2=value2”. |
| GetEnumerator() | |
| GetValue(string) | Retrieves the last value associated with the specified key. Returns null if the key does not exist. |
| GetValues(string) | Retrieves all values associated with the specified key. Returns an empty array if the key does not exist. |
| ImportCookieString(string) | Imports key-value pairs from a cookie string into the StringKeyStoreCollection. The query string should be in the format of “key1=value1; key2=value2”. |
| ImportNameValueCollection(NameValueCollection) | Imports key-value pairs from a NameValueCollection into the StringKeyStoreCollection. Each key can have multiple associated values. |
| ImportQueryString(string) | Imports key-value pairs from a query string into the StringKeyStoreCollection. The query string should be in the format of “key1=value1&key2=value2”. |
| MakeReadOnly() | Marks the StringKeyStoreCollection as read-only, preventing further modifications. |
| Remove(string) | Removes the value associated with the specified key from the StringKeyStoreCollection. Throws an exception if the store is read-only. |
| Set(KeyValuePair<string, string[]>) | Sets the value associated with the specified key, replacing any existing values. |
| Set(string, string) | Sets the value associated with the specified key, replacing any existing values. |
| Set(string, IEnumerable<string>) | Sets the collection of values associated with the specified key, replacing any existing values. |
| SetRange(IEnumerable<KeyValuePair<string, string[]>>) | Sets the elements of the specified collection, replacing existing values. |
| ToString() | Returns a string that represents the current object. |
| ToString(IFormatProvider?) | Returns a string that represents the current object, using the specified format provider. |
| TryGetValue(string, out string[]) | Tries to get the array of values associated with the specified key. |