I am writing a simple plugin system for my .NET app written in C#. I am trying to use IronPython to accomplish this.

In my .NET code i Have created an interface IPlugin, which all Plugins must implement.
Users of the program specify a path to the python file, which can have many classes within them that implement IPlugin, as well as classes that done.

The issue I am having is once I have got a CompiledCode object and its ScriptScope, I want to iterate through all the classes defined in the code, and then instiantiate new instances of those that implement the IPlugin interface. I have no idea how to do this, besides blindly instantiating all IronPythonType objects, and then checking if the resulting object is of type IPlugin. This is not idea.