[Ironruby-core] Getting the .NET type of an IronRuby class

Michael Letterle michael.letterle at gmail.com
Sat Feb 9 14:09:28 EST 2008


resources = System::ComponentModel::ComponentResoruceManager.new( X.GetType)

or if you'd rather:

require 'mscorlib'

def typeof(object)
    System::Type.GetTypeFromHandle(System::Type.GetTypeHandle(object))
end


On Feb 9, 2008 1:42 PM, Dermot Hogan <lists at ruby-forum.com> wrote:
> Is there a simple way of getting the .NET type of an IronRuby class?
>
> I have this code:
>
> resources =
> System::ComponentModel::ComponentResourceManager.new(X.class)
>
> where X is a class. But this doesn't do it - I get a run time exception.
>
>
> Any ideas?
>
> Dermot
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>



-- 
Michael Letterle
[Polymath Programmer]
http://michaeldotnet.blogspot.com


More information about the Ironruby-core mailing list