This documentation is archived and is not being maintained.

OperationCollection.Remove Method

Removes the first occurrence of the specified Operation from the OperationCollection.

[Visual Basic]
Public Sub Remove( _
   ByVal operation As Operation _
)
[C#]
public void Remove(
 Operation operation
);
[C++]
public: void Remove(
 Operation* operation
);
[JScript]
public function Remove(
   operation : Operation
);

Parameters

operation
The Operation to remove from the collection.

Remarks

This method performs a linear search; therefore, the average execution time is proportional to Count.

The elements that follow the removed Operation move up to occupy the vacated spot.

Example

[Visual Basic, C#, C++] The following example demonstrates the use of the Remove method.

[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 Language Filter 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

Show: