This documentation is archived and is not being maintained.
OperationMessageCollection::Item Property
Visual Studio 2008
Gets or sets the value of an OperationMessage at the specified zero-based index.
Assembly: System.Web.Services (in System.Web.Services.dll)
public: property OperationMessage^ Item[int index] { OperationMessage^ get (int index); void set (int index, OperationMessage^ value); }
Parameters
- index
- Type: System::Int32
The zero-based index of the OperationMessage whose value is modified or returned.
// Get the operation message for the Add operation. OperationMessage^ myOperationMessage = myOperationMessageCollection[ 0 ]; OperationMessage^ myInputOperationMessage = dynamic_cast<OperationMessage^>(gcnew OperationInput); XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "AddSoapIn",myDescription->TargetNamespace ); myInputOperationMessage->Message = myXmlQualifiedName; array<OperationMessage^>^myCollection = gcnew array<OperationMessage^>(myOperationMessageCollection->Count); myOperationMessageCollection->CopyTo( myCollection, 0 ); Console::WriteLine( "Operation name(s) :" ); for ( int i = 0; i < myCollection->Length; i++ ) { Console::WriteLine( " {0}", myCollection[ i ]->Operation->Name ); } // Add the OperationMessage to the collection. myOperationMessageCollection->Add( myInputOperationMessage ); DisplayFlowInputOutput( myOperationMessageCollection, "Add" ); if ( myOperationMessageCollection->Contains( myOperationMessage ) == true ) { int myIndex = myOperationMessageCollection->IndexOf( myOperationMessage ); Console::WriteLine( " The index of the Add operation message in the collection is : {0}", myIndex ); }
// Get the operation message for the Add operation.
OperationMessage* myOperationMessage =
myOperationMessageCollection->Item[0];
OperationMessage* myInputOperationMessage =
dynamic_cast<OperationMessage*> (new OperationInput());
XmlQualifiedName* myXmlQualifiedName = new XmlQualifiedName(
S"AddSoapIn", myDescription->TargetNamespace);
myInputOperationMessage->Message = myXmlQualifiedName;
OperationMessage* myCollection[] =
new OperationMessage*[myOperationMessageCollection->Count];
myOperationMessageCollection->CopyTo(myCollection, 0);
Console::WriteLine(S"Operation name(s) :");
for (int i = 0; i < myCollection->Length ; i++)
{
Console::WriteLine(S" {0}", myCollection[i]->Operation->Name);
}
// Add the OperationMessage to the collection.
myOperationMessageCollection->Add(myInputOperationMessage);
DisplayFlowInputOutput(myOperationMessageCollection, S"Add");
if(myOperationMessageCollection->Contains(myOperationMessage)
== true )
{
int myIndex =
myOperationMessageCollection->IndexOf(myOperationMessage);
Console::WriteLine(S" The index of the Add operation message in the collection is : {0}", __box(myIndex));
}
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: