views:

35

answers:

0

I have an IronRuby script like this one:

class MyClassA < NamespaceMaze::BaseClass
    description = "I'm MyClassA"
    # <snip> some methods
end

class HelperClass; end

class MyClassC < NamespaceMaze::BaseClass
    description = "I'm MyClassC"
    # <snip> some methods
end

And a .net class like this one:

namespace NamespaceMaze
{
    public class BaseClass
    {
        public static string Description
        {
            get; protected set;
        }
        // <snip> some more methods and properties
    }
}

Now, in C#, i load the script. Then I want to do three things:

  1. Figure out what types are defined in the script which inherit from BaseClass
  2. Read their Description property
  3. Create some instances

All three steps would be relatively easy if I had the System::Type objects for the classes... So how do I get them? I know that the ScriptRuntime-object has the "Globals"-Property which contains a dictionary of strings and dynamic-objects... But what next?