C# TypeInfo GetInterfaces
Description
TypeInfo GetInterfaces
When overridden in a derived
class, gets all the interfaces implemented or inherited by the current Type.
Syntax
TypeInfo.GetInterfaces
has the following syntax.
public abstract Type[] GetInterfaces()
Returns
TypeInfo.GetInterfaces
method returns
Example
// www . ja va 2 s .c om
using System;
using System.Collections.Generic;
public class Example
{
static void Main()
{
Console.WriteLine("\r\nInterfaces implemented by Dictionary<int, string>:\r\n");
foreach (Type tinterface in typeof(Dictionary<int, string>).GetInterfaces())
{
Console.WriteLine(tinterface.ToString());
}
}
}
The code above generates the following result.