ServiceDescriptionFormatExtensionCollection.Find メソッド
ServiceDescriptionFormatExtensionCollection を検索し、渡されたパラメータによって指定されたコレクションの最初のメンバを返します。
オーバーロードの一覧
ServiceDescriptionFormatExtensionCollection を検索し、指定した派生 Type の最初の要素を返します。
[Visual Basic] Overloads Public Function Find(Type) As Object
[JScript] public function Find(Type) : Object;
このメソッドは、 ServiceDescriptionFormatExtensionCollection 内で、指定した名前と名前空間の URI を持つメンバを検索します。
[Visual Basic] Overloads Public Function Find(String, String) As XmlElement
[JScript] public function Find(String, String) : XmlElement;
使用例
[Visual Basic, C#, C++] メモ ここでは、Find のオーバーロード形式のうちの 1 つだけについて、使用例を示します。その他の例については、各オーバーロード形式のトピックを参照してください。
' Check element of type 'SoapAddressBinding' in collection.
Dim myObj As Object = myCollection.Find(mySoapAddressBinding.GetType())
If myObj Is Nothing Then
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())
End If
[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());
}
[C++]
// Check element of type 'SoapAddressBinding' in collection.
Object* myObj = myCollection->Find(mySoapAddressBinding->GetType());
if (myObj == 0)
Console::WriteLine(S"Element of type ' {0}' not found in collection.",
mySoapAddressBinding->GetType());
else
Console::WriteLine(S"Element of type ' {0}' found in collection.",
mySoapAddressBinding->GetType());
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
参照
ServiceDescriptionFormatExtensionCollection クラス | ServiceDescriptionFormatExtensionCollection メンバ | System.Web.Services.Description 名前空間