ServiceDescriptionFormatExtensionCollection.Find Method (String, String)

This method searches the ServiceDescriptionFormatExtensionCollection for a member with the specified name and namespace URI.

Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)

public:
XmlElement^ Find (
	String^ name, 
	String^ ns
)
public XmlElement Find (
	String name, 
	String ns
)
public function Find (
	name : String, 
	ns : String
) : XmlElement
Not applicable.

Parameters

name

The name of the XmlElement to be found.

ns

The XML namespace URI of the XmlElement to be found.

Return Value

If the search is successful, an XmlElement; otherwise a null reference (Nothing in Visual Basic).

This method searches the collection in index order, and returns the first XmlElement that meets the criteria of the two parameters.

// Check element of type 'SoapAddressBinding' in collection.
Object^ myObj = myCollection->Find( mySoapAddressBinding->GetType() );
if ( myObj == nullptr )
      Console::WriteLine( "Element of type ' {0}' not found in collection.", mySoapAddressBinding->GetType() );
else
      Console::WriteLine( "Element of type ' {0}' found in collection.", mySoapAddressBinding->GetType() );

// Check element of type 'SoapAddressBinding' in collection.
Object myObj = myCollection.Find(mySoapAddressBinding.GetType());
if (myObj == null) {
    Console.WriteLine(
        "Element of type '{0}' not found in collection.", 
        mySoapAddressBinding.GetType().ToString());
}
else {
    Console.WriteLine(
        "Element of type '{0}' found in collection.", 
        mySoapAddressBinding.GetType().ToString());
}

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: