AddGraphDataProvidersFromType
(
Type oType,
List<Object> oGraphDataProviders
)
{
Debug.Assert(oType != null);
Debug.Assert(oGraphDataProviders != null);
// The techniques for checking types for a specified interface and
// instantiating instances of those types are from the article "Let
// Users Add Functionality to Your .NET Applications with Macros and
// Plug-Ins" in the October 2003 issue of MSDN Magazine.
if (!oType.IsAbstract)
{
if (
typeof(IGraphDataProvider2).IsAssignableFrom(oType)
||
typeof(IGraphDataProvider).IsAssignableFrom(oType)
)
{
oGraphDataProviders.Add( Activator.CreateInstance(oType) );
}
}
}