Class CustomHttpHeadersCollection
Represents a collection of custom HTTP headers, keyed by name.
Inheritance
Inherited Members
Namespace: Rssdp
Assembly: cs.temp.dll.dll
Syntax
public class CustomHttpHeadersCollection : IEnumerable<CustomHttpHeader>, IEnumerable
Constructors
CustomHttpHeadersCollection()
Default constructor.
Declaration
public CustomHttpHeadersCollection()
CustomHttpHeadersCollection(Int32)
Full constructor.
Declaration
public CustomHttpHeadersCollection(int capacity)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | capacity | Specifies the initial capacity of the collection. |
Properties
Count
Returns the number of items in the collection.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Item[String]
Returns the CustomHttpHeader instance from the collection that has the specified Name value.
Declaration
public CustomHttpHeader this[string name] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The full name of the property to return. |
Property Value
| Type | Description |
|---|---|
| CustomHttpHeader | A CustomHttpHeader instance from the collection. |
Exceptions
| Type | Condition |
|---|---|
| System.Collections.Generic.KeyNotFoundException | Thrown if no item exists in the collection with the specified |
Methods
Add(CustomHttpHeader)
Adds a CustomHttpHeader instance to the collection.
Declaration
public void Add(CustomHttpHeader header)
Parameters
| Type | Name | Description |
|---|---|---|
| CustomHttpHeader | header | The CustomHttpHeader instance to add to the collection. |
Remarks
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
Contains(CustomHttpHeader)
Returns a boolean indicating whether or not the specified CustomHttpHeader instance is in the collection.
Declaration
public bool Contains(CustomHttpHeader header)
Parameters
| Type | Name | Description |
|---|---|---|
| CustomHttpHeader | header | An CustomHttpHeader instance to check the collection for. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the specified instance exists in the collection, otherwise false. |
Contains(String)
Returns a boolean indicating whether or not a CustomHttpHeader instance with the specified full name value exists in the collection.
Declaration
public bool Contains(string headerName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | headerName | A string containing the full name of the CustomHttpHeader instance to check for. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if an item with the specified full name exists in the collection, otherwise false. |
GetEnumerator()
Returns an enumerator of CustomHttpHeader instances in this collection.
Declaration
public IEnumerator<CustomHttpHeader> GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerator<CustomHttpHeader> | An enumerator of CustomHttpHeader instances in this collection. |
Remove(CustomHttpHeader)
Removes the specified header instance from the collection.
Declaration
public bool Remove(CustomHttpHeader header)
Parameters
| Type | Name | Description |
|---|---|---|
| CustomHttpHeader | header | The CustomHttpHeader instance to remove from the collection. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if an item was removed from the collection, otherwise false (because it did not exist or was not the same instance). |
Remarks
Only removes the specified header if that instance was in the collection, if another header with the same name exists in the collection it is not removed.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if the |
See Also
Remove(String)
Removes the property with the specified key (Name from the collection.
Declaration
public bool Remove(string headerName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | headerName | The name of the CustomHttpHeader instance to remove from the collection. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if an item was removed from the collection, otherwise false (because no item exists in the collection with that key). |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown if the |