G
Guest
Hi
Look at the TODO in the code. The commented code do not work, but the code
below the commented one does. How do I do to compare Types?
foreach (Type typeInAssembly in typesInAssemply)
{
// typeLoadException.Types can generate null values.
if (typeInAssembly != null && !typeInAssembly.IsAbstract)
{
foreach (Type interfaceType in typeInAssembly.GetInterfaces())
{
//TODO: Whats wrong with this: if (interfaceType ==
typeof(IInstrumentAdministrator) ???
if (interfaceType.Name == typeof(IInstrumentAdministrator).Name)
{
typesWithInterface.Add(typeInAssembly);
}
}
}
}
Regards
/Niklas
Look at the TODO in the code. The commented code do not work, but the code
below the commented one does. How do I do to compare Types?
foreach (Type typeInAssembly in typesInAssemply)
{
// typeLoadException.Types can generate null values.
if (typeInAssembly != null && !typeInAssembly.IsAbstract)
{
foreach (Type interfaceType in typeInAssembly.GetInterfaces())
{
//TODO: Whats wrong with this: if (interfaceType ==
typeof(IInstrumentAdministrator) ???
if (interfaceType.Name == typeof(IInstrumentAdministrator).Name)
{
typesWithInterface.Add(typeInAssembly);
}
}
}
}
Regards
/Niklas