ServiceDescriptionFormatExtensionCollection を検索し、指定した Type のすべての要素の配列を返します。
Overloads Public Function FindAll( _
ByVal type As Type _) As Object()
[C#]
public object[] FindAll(Typetype);
[C++]
public: Object* FindAll(Type* type) __gc[];
[JScript]
public function FindAll(
type : Type) : Object[];
パラメータ
- type
コレクション内での検索対象となる Type 。
戻り値
指定した型のすべてのコレクション メンバを表す Object インスタンスの配列。
解説
メモ 検索が失敗した場合、空の配列が返されます。
使用例
' 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())
[C#]
// 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());
[C++]
// 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());
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
ServiceDescriptionFormatExtensionCollection クラス | ServiceDescriptionFormatExtensionCollection メンバ | System.Web.Services.Description 名前空間 | ServiceDescriptionFormatExtensionCollection.FindAll オーバーロードの一覧