• # Type.GetInterfaces()

    Posté par . En réponse au message Problème avec IsSubclassOf. Évalué à 2.

    using System;
    using System.Reflection;

    public class plugin
    {
    public static void Main(string[] args)
    {
    foreach(string path in args)
    {
    Assembly asm = Assembly.LoadFrom(path);

    foreach(Type t in asm.GetTypes())
    {
    foreach(Type i in t.GetInterfaces())
    {
    if(i == typeof(System.Collections.ICollection))
    {
    Console.WriteLine(t);
    break;
    }
    }
    }
    }
    }
    }


    PS: désolé pour l'indentation de merde, ça fait des années qu'on réclame un balise tt qui fonctionne :o