OperationCollection.Item Property
Gets or sets the value of an Operation at the specified zero-based index.
[C#] In C#, this property is the indexer for the OperationCollection class.
[Visual Basic] Public Default Property Item( _ ByVal index As Integer _ ) As Operation [C#] public Operation this[ int index ] {get; set;} [C++] public: __property Operation* get_Item( int index ); public: __property void set_Item( int index, Operation* ); [JScript] returnValue = OperationCollectionObject.Item(index); OperationCollectionObject.Item(index) = returnValue; -or- returnValue = OperationCollectionObject(index); OperationCollectionObject(index) = returnValue;
[JScript] In JScript, you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.
Arguments [JScript]
- index
- The zero-based index of the Operation whose value is modified or returned.
Parameters [Visual Basic, C#, C++]
- index
- The zero-based index of the Operation whose value is modified or returned.
Property Value
An Operation.
Example
[Visual Basic, C#, C++] The following example demonstrates the use of the zero-based index to retrieve a member of the OperationCollection.
[Visual Basic] myOperationCollection.Remove(myOperation) ' Insert the 'myOpearation' operation at the index '0'. myOperationCollection.Insert(0, myOperation) Console.WriteLine("The operation at index '0' is : " + _ myOperationCollection.Item(0).Name) [C#] myOperationCollection.Remove(myOperation); // Insert the 'myOpearation' operation at the index '0'. myOperationCollection.Insert(0, myOperation); Console.WriteLine("The operation at index '0' is : " + myOperationCollection[0].Name); [C++] myOperationCollection->Remove(myOperation); // Insert the 'myOpearation' operation at the index '0'. myOperationCollection->Insert(0, myOperation); Console::WriteLine(S"The operation at index '0' is : {0}", myOperationCollection->Item[0]->Name);
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
OperationCollection Class | OperationCollection Members | System.Web.Services.Description Namespace