ServiceDescriptionFormatExtensionCollection.FindAll 方法
定义
搜索 ServiceDescriptionFormatExtensionCollection 以查找由传入的参数所指定的集合的所有成员。Searches the ServiceDescriptionFormatExtensionCollection for all members of the collection specified by the parameter passed in.
重载
| FindAll(Type) |
搜索 ServiceDescriptionFormatExtensionCollection 并返回指定的 Type 的所有元素的数组。Searches the ServiceDescriptionFormatExtensionCollection and returns an array of all elements of the specified Type. |
| FindAll(String, String) |
搜索 ServiceDescriptionFormatExtensionCollection 并返回具有指定名称和命名空间 URI 的所有成员的数组。Searches the ServiceDescriptionFormatExtensionCollection and returns an array of all members with the specified name and namespace URI. |
FindAll(Type)
搜索 ServiceDescriptionFormatExtensionCollection 并返回指定的 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()
参数
返回
- Object[]
表示指定类型的所有集合成员的 Object 实例的数组。An array of Object instances representing all collection members of the specified type.
示例
// 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())
注解
备注
如果搜索未成功,则返回的数组为空。The array returned is empty if the search is unsuccessful.
适用于
FindAll(String, String)
搜索 ServiceDescriptionFormatExtensionCollection 并返回具有指定名称和命名空间 URI 的所有成员的数组。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()
参数
- name
- String
要查找的 XmlElement 对象的 XML 名称特性。The XML name attribute of the XmlElement objects to be found.
- ns
- String
要查找的 XmlElement 对象的 XML 命名空间 URI 特性。The XML namespace URI attribute of the XmlElement objects to be found.
返回
XmlElement 实例的数组。An array of XmlElement instances.
注解
备注
如果搜索未成功,则返回的数组为空。The array returned is empty if the search is unsuccessful.