Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

HttpChallengeHeaderValueCollection.Item property

Applies to Windows and Windows Phone

Gets or sets the element at the specified index.

Syntax


public HttpChallengeHeaderValue this[int index] { get; set; }

Property value

Type: HttpChallengeHeaderValue

The element at the specified index.

Remarks

The Item indexer property provides the support for a collection indexer syntax in C# and Microsoft Visual Basic. The collection is zero-indexed. You specify the indexed value you want by enclosing the index number within square brackets if using C#, or parentheses if using Visual Basic.

The Item indexer property is settable, so you can use the indexer syntax to replace the value of an existing item in the collection. Setting to an existing item in the collection using the indexer syntax won't expand the collection, and the item you replace won't be in the collection anymore. If you want to expand the collection, use Insert (to add to the start or middle) or Add (to add to the end).

Using the indexer syntax with an index value that's greater than or equal to the Count value of the collection throws an exception; you can't use the indexer syntax to set to an index that doesn't exist yet.

If you don't know the index of an item in a collection, you can call IndexOf.

If you are programming using Visual C++ component extensions (C++/CX), see GetAt and SetAt.

Requirements

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Web.Http.Headers

See also

HttpChallengeHeaderValueCollection
Insert
IndexOf

 

 

Show:
© 2014 Microsoft