Bewerken

Delen via


ServiceDescriptionFormatExtensionCollection.Find Method

Definition

Searches the ServiceDescriptionFormatExtensionCollection and returns the first member of the collection specified by the parameter passed in.

Overloads

Find(Type)

Searches the ServiceDescriptionFormatExtensionCollection and returns the first element of the specified derived Type.

Find(String, String)

Searches the ServiceDescriptionFormatExtensionCollection for a member with the specified name and namespace URI.

Find(Type)

Searches the ServiceDescriptionFormatExtensionCollection and returns the first element of the specified derived Type.

public:
 System::Object ^ Find(Type ^ type);
public object Find (Type type);
member this.Find : Type -> obj
Public Function Find (type As Type) As Object

Parameters

type
Type

A Type for which to search the collection.

Returns

If the search is successful, an object of the specified Type; otherwise, null.

Remarks

This method searches the collection in index order, and returns only the matching element with the lowest-numbered index.

Applies to

Find(String, String)

Searches the ServiceDescriptionFormatExtensionCollection for a member with the specified name and namespace URI.

public:
 System::Xml::XmlElement ^ Find(System::String ^ name, System::String ^ ns);
public System.Xml.XmlElement Find (string name, string ns);
member this.Find : string * string -> System.Xml.XmlElement
Public Function Find (name As String, ns As String) As XmlElement

Parameters

name
String

The name of the XmlElement to be found.

ns
String

The XML namespace URI of the XmlElement to be found.

Returns

If the search is successful, an XmlElement; otherwise, null.

Examples

// 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());
}
' Check element of type 'SoapAddressBinding' in collection.
Dim myObj As Object = myCollection.Find(mySoapAddressBinding.GetType())
If myObj Is Nothing Then
   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())
End If

Remarks

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

Applies to