How to verify c# Assembly Implements a Certain Interface?
private static void LoadPlugins(IList<Assembly> assemblies)
{
DirectoryInfo dInfo = new DirectoryInfo(GetExtensionsDirectory());
FileInfo[] files = dInfo.GetFiles("*.dll");
if (null != files)
{
foreach (FileInfo file in files)
{
string[] fileArray = file.Name.Split('.');
if (fileArray != null)
{ // I want to verify if assembly implements a IPlugin interface before adding assemebly.
assemblies.Add(Assembly.Load(fileArray[0]));
}
}
}
}