Type.FindInterfaces Method (TypeFilter, Object)
Assembly: mscorlib (in mscorlib.dll)
The delegate that compares the interfaces against filterCriteria.
The search criteria that determines whether an interface should be included in the returned array.
Return ValueType: System.Type
An array of Type objects representing a filtered list of the interfaces implemented or inherited by the current Type, or an empty array of type Type if no interfaces matching the filter are implemented or inherited by the current Type.
This method can be overridden by a derived class.
All of the interfaces implemented by this class are considered during the search, whether declared by a base class or this class itself.
This method searches the base class hierarchy, returning each of the matching interfaces each class implements as well as all the matching interfaces each of those interfaces implements (that is, the transitive closure of the matching interfaces is returned). No duplicate interfaces are returned.
If the current Type represents a type parameter in the definition of a generic type or generic method, searches all the interfaces declared in the constraints on the type parameter, and all interfaces inherited through the interfaces declared in the constraints. If the current Type represents a type argument of a generic type, searches all the interfaces implemented by the type, whether or not they match constraints.
IEnumerable<int> (IEnumerable(Of Integer) in Visual Basic).can return generic interfaces, even on types that are not generic. For example, a nongeneric type might implement
The following example finds the specified interface implemented or inherited by the specified type, and then displays the interface names.
string myDiscoFile = "http://localhost/MathService_cs.vsdisco"; string myEncoding = ""; DiscoveryClientProtocol myDiscoveryClientProtocol = new DiscoveryClientProtocol(); Stream myStream = myDiscoveryClientProtocol.Download (ref myDiscoFile,ref myEncoding); Console.WriteLine("The length of the stream in bytes: "+ myStream.Length); Console.WriteLine("The MIME encoding of the downloaded "+ "discovery document: "+ myEncoding); myStream.Close();
Available since 1.1