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.

C#
public object Find(Type type);

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

.NET Framework 4.8.1 и друге верзије
Производ Верзије
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

Find(String, String)

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

C#
public System.Xml.XmlElement Find(string name, string ns);

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

C#
// 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());
}

Remarks

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

Applies to

.NET Framework 4.8.1 и друге верзије
Производ Верзије
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)