Class CommandCollection
Represents an ordered collection of processing commands.
Inheritance
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Web.Commands
Assembly: SixLabors.ImageSharp.Web.dll
Syntax
public sealed class CommandCollection : KeyedCollection<string, KeyValuePair<string, string>>, IList<KeyValuePair<string, string>>, ICollection<KeyValuePair<string, string>>, IReadOnlyList<KeyValuePair<string, string>>, IReadOnlyCollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IList, ICollection, IEnumerable
Constructors
| Improve this Doc View SourceCommandCollection()
Initializes a new instance of the CommandCollection class.
Declaration
public CommandCollection()
Properties
| Improve this Doc View SourceItem[String]
Gets or sets the value associated with the specified key.
Declaration
public string this[string key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
String | key | The key of the value to get or set. |
Property Value
Type | Description |
---|---|
String | The value associated with the specified key. If the specified key is not found, a get operation throws a KeyNotFoundException, and a set operation creates a new element with the specified key. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
KeyNotFoundException | An element with the specified key does not exist in the collection. |
Keys
Gets an IEnumerable<T> representing the keys of the collection.
Declaration
public IEnumerable<string> Keys { get; }
Property Value
Type | Description |
---|---|
IEnumerable<String> |
Methods
| Improve this Doc View SourceAdd(String, String)
Adds an element with the provided key and value to the CommandCollection.
Declaration
public void Add(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
String | key | The String to use as the key of the element to add. |
String | value | The String to use as the value of the element to add. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
FindIndex(Predicate<String>)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire CommandCollection.
Declaration
public int FindIndex(Predicate<string> match)
Parameters
Type | Name | Description |
---|---|---|
Predicate<String> | match | The Predicate<T> delegate that defines the conditions of the element to search for. |
Returns
Type | Description |
---|---|
Int32 | The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, -1. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GetKeyForItem(KeyValuePair<String, String>)
Declaration
protected override string GetKeyForItem(KeyValuePair<string, string> item)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<String, String> | item |
Returns
Type | Description |
---|---|
String |
Overrides
IndexOf(String)
Searches for the specified key and returns the zero-based index of the first occurrence within the entire CommandCollection.
Declaration
public int IndexOf(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key to locate in the CommandCollection. |
Returns
Type | Description |
---|---|
Int32 | The zero-based index of the first occurrence of key within the entire CommandCollection, if found; otherwise, -1. |
Insert(Int32, String, String)
Inserts an element into the CommandCollection at the specified index.
Declaration
public void Insert(int index, string key, string value)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based index at which item should be inserted. |
String | key | The String to use as the key of the element to insert. |
String | value | The String to use as the value of the element to insert. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | index is less than zero. -or- index is greater than CommandCollection.Count. |
TryGetValue(String, out String)
Gets the value associated with the specified key.
Declaration
public bool TryGetValue(string key, out string value)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key whose value to get. |
String | value | When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
Returns
Type | Description |
---|---|
Boolean | true if the object that implements CommandCollection contains an element with the specified key; otherwise, false. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|