Smrf.NodeXL.ExcelTemplate.PlugInManager.AddGraphDataProvidersFromType C# (CSharp) Method

AddGraphDataProvidersFromType() private static method

private static AddGraphDataProvidersFromType ( Type oType, List oGraphDataProviders ) : void
oType System.Type
oGraphDataProviders List
return void
    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) );
            }
        }
    }