ServiceDescriptionFormatExtensionCollection.FindAll Method (Type)

 

Searches the ServiceDescriptionFormatExtensionCollection and returns an array of all elements of the specified Type.

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

Public Function FindAll (
	type As Type
) As Object()

Parameters

type
Type: System.Type

A Type for which to search the collection.

Return Value

Type: System.Object()

An array of Object instances representing all collection members of the specified type.

System_CAPS_noteNote

The array returned is empty if the search is unsuccessful.

' Check all elements of type 'SoapBinding' in collection.
Dim myObjectArray1(myCollection.Count -1 ) As Object
myObjectArray1 = myCollection.FindAll(mySoapBinding1.GetType())
Dim myNumberOfElements As Integer = 0
Dim myIEnumerator As IEnumerator = myObjectArray1.GetEnumerator()

' Calculate number of elements of type 'SoapBinding'.
While myIEnumerator.MoveNext()
   If mySoapBinding1.GetType() Is  myIEnumerator.Current.GetType() Then
      myNumberOfElements += 1
   End If
End While
Console.WriteLine("Collection contains {0} objects of type '{1}'.", _
        myNumberOfElements.ToString(), mySoapBinding1.GetType().ToString())

.NET Framework
Available since 1.1
Return to top
Show: