2012-11-20 17 views

risposta

15

Perché non scoprire con un programma semplice?

foreach(var interfaceType in typeof(Group).GetInterfaces()) 
{ 
    Console.WriteLine(interfaceType); 
} 

uscita:

System.IComparable 
System.IFormattable 
System.IConvertible 

proposito, tutti questi provengono dal tipo di base enum System.Enum, che ha la seguente dichiarazione secondo MSDN:

[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public abstract class Enum : ValueType, 
    IComparable, IFormattable, IConvertible 
+0

Interessante ... sempre Supponendo che implementerebbe invece le interfacce del tipo sottostante. –

+0

Non penso che un programma del genere mostri necessariamente tutte le interfacce implementate da una classe. Ad esempio, un 'DerivedType []' implementa 'IList ' anche se 'IList ' non è covariante, e anche se 'IList ' non sarebbe tra le interfacce elencate. – supercat

Problemi correlati