This documentation is archived and is not being maintained.

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:
array<Object^>^ FindAll(
	Type^ type
)

Parameters

type
Type: System::Type

A Type for which to search the collection.

Return Value

Type: array<System::Object>
An array of Object instances representing all collection members of the specified type.

NoteNote:

The array returned is empty if the search is unsuccessful.

// Check all elements of type 'SoapBinding' in collection. 
array<Object^>^myObjectArray1 = gcnew array<Object^>(myCollection->Count);
myObjectArray1 = myCollection->FindAll( mySoapBinding1->GetType() );
int myNumberOfElements = 0;
IEnumerator^ myIEnumerator = myObjectArray1->GetEnumerator();

// Calculate number of elements of type 'SoapBinding'. 
while ( myIEnumerator->MoveNext() )
      if ( mySoapBinding1->GetType() == myIEnumerator->Current->GetType() )
      myNumberOfElements++;
Console::WriteLine( "Collection contains {0} objects of type ' {1}'.", myNumberOfElements, mySoapBinding1->GetType() );
// Check all elements of type 'SoapBinding' in collection.
Object* myObjectArray1[] = new Object*[myCollection->Count];
myObjectArray1 = myCollection->FindAll(mySoapBinding1->GetType());
int myNumberOfElements = 0;
IEnumerator* myIEnumerator  = myObjectArray1->GetEnumerator();

// Calculate number of elements of type 'SoapBinding'.
while(myIEnumerator->MoveNext()) 
   if (mySoapBinding1->GetType() == myIEnumerator->Current->GetType())
      myNumberOfElements++;
Console::WriteLine(S"Collection contains {0} objects of type ' {1}'.",
   __box(myNumberOfElements),
   mySoapBinding1->GetType());

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.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Show: