Class CommandCollection
Represents an ordered collection of processing commands.
Namespace: SixLabors.ImageSharp.Web.Commands
Assembly: SixLabors.ImageSharp.Web.dll
Syntax
public sealed class CommandCollection : KeyedCollection<string, KeyValuePair<string, string?>>
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 |
Keys
Gets an
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 | value | The |
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 |
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. |
GetKeyForItem(KeyValuePair<String, Nullable<String>>)
Declaration
protected override string GetKeyForItem(KeyValuePair<string, string?> item)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<String, Nullable<String>> | item |
Returns
Type | Description |
---|---|
String |
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 | value | The |
TryGetValue(String, out Nullable<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. |
Nullable<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. |