Bewerken

Delen via


ServiceDescriptionFormatExtensionCollection.FindAll Method

Definition

Searches the ServiceDescriptionFormatExtensionCollection for all members of the collection specified by the parameter passed in.

Overloads

FindAll(Type)

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

FindAll(String, String)

Searches the ServiceDescriptionFormatExtensionCollection and returns an array of all members with the specified name and namespace URI.

FindAll(Type)

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

public:
 cli::array <System::Object ^> ^ FindAll(Type ^ type);
public object[] FindAll (Type type);
member this.FindAll : Type -> obj[]
Public Function FindAll (type As Type) As Object()

Parameters

type
Type

A Type for which to search the collection.

Returns

Object[]

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

Examples

// 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("Collection contains {0} objects of type '{1}'.",
                  myNumberOfElements.ToString(),
                  mySoapBinding1.GetType().ToString());
' 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())

Remarks

Note

The array returned is empty if the search is unsuccessful.

Applies to

FindAll(String, String)

Searches the ServiceDescriptionFormatExtensionCollection and returns an array of all members with the specified name and namespace URI.

public:
 cli::array <System::Xml::XmlElement ^> ^ FindAll(System::String ^ name, System::String ^ ns);
public System.Xml.XmlElement[] FindAll (string name, string ns);
member this.FindAll : string * string -> System.Xml.XmlElement[]
Public Function FindAll (name As String, ns As String) As XmlElement()

Parameters

name
String

The XML name attribute of the XmlElement objects to be found.

ns
String

The XML namespace URI attribute of the XmlElement objects to be found.

Returns

An array of XmlElement instances.

Remarks

Note

The array returned is empty if the search is unsuccessful.

Applies to