<div>Normally </div><div>foo = x::y::z::Foo.new(1)</div><div><br></div>in the console you need to use global variables:<div>$foo = x::y::z::Foo.new(1)<br clear="all"><br><br><div class="gmail_quote">On Mon, Dec 8, 2008 at 10:43 PM, Aaron Feng <span dir="ltr"><<a href="mailto:aaron.feng@gmail.com">aaron.feng@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I tried to load the struct the same way, but I don't know how to set the value of it. For example:<br><br>C#<br><br>
namespace x.y.z {<br> public struct Foo {<br> public long Bar;<br> public Foo(long bar) {<br>
this.Bar = bar;<br> }<br> }<br>}<br><br>var foo = new x.y.z.Foo(1);<br><br>IronRuby<br><br>Foo = Type.get_type("x.y.z.Foo, MyAssembly, Version=<a href="http://1.0.0.0" target="_blank">1.0.0.0</a>, Culture=neutral, PublicKeyToken=null", true).to_class<br>
<br># how do I do the equivalent of <br># var foo = new x.y.z.Foo(1); ? <br><br>Aaron<br><br><br><div class="gmail_quote">On Mon, Dec 8, 2008 at 3:45 PM, Tomas Matousek <span dir="ltr"><<a href="mailto:Tomas.Matousek@microsoft.com" target="_blank">Tomas.Matousek@microsoft.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)">You can use Assembly.LoadFile and point it to an absolute path
instead.</span></p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)"> </span></p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)">Tomas</span></p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)"> </span></p>
<div style="border-style:solid none none;border-color:rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color;border-width:1pt medium medium;padding:3pt 0in 0in">
<p><b><span style="font-size:10pt">From:</span></b><span style="font-size:10pt">
<a href="mailto:ironruby-core-bounces@rubyforge.org" target="_blank">ironruby-core-bounces@rubyforge.org</a>
[mailto:<a href="mailto:ironruby-core-bounces@rubyforge.org" target="_blank">ironruby-core-bounces@rubyforge.org</a>] <b>On Behalf Of </b>Aaron Feng<br>
<b>Sent:</b> Monday, December 08, 2008 12:33 PM<div><div></div><div><br>
<b>To:</b> <a href="mailto:ironruby-core@rubyforge.org" target="_blank">ironruby-core@rubyforge.org</a><br>
<b>Subject:</b> Re: [Ironruby-core] Handling C# lower case namespaces</div></div></span></p>
</div><div><div></div><div><div class="Ih2E3d">
<p> </p>
<p style="margin-bottom:12pt"><span style="color:black">Ok,
I got </span><span style="font-size:11pt;color:black">Assembly.Load and
Type.get_type both to work with my own DLL. The actual DLL have to live
where ir.exe lives. Is there a way for it to look in the directory of the
ruby file? Like the way require statement work.<br>
<br>
Aaron<br>
</span><span style="font-size:11pt;color:rgb(31, 73, 125)"><br>
<br>
</span></p>
</div><div>
<p>On Mon, Dec 8, 2008 at 2:11 PM, Tomas Matousek <<a href="mailto:Tomas.Matousek@microsoft.com" target="_blank">Tomas.Matousek@microsoft.com</a>>
wrote:</p>
<div>
<div>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)">Can you load the assembly and
get the type explicitly?</span></p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)"> </span></p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)">require 'mscorlib'</span></p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)">System::Reflection::Assembly.Load("IronNails.Library,
Version=<a href="http://1.0.0.0" target="_blank">1.0.0.0</a>, Culture=neutral,
PublicKeyToken=null").GetType(</span>'IronNails.View.XamlProxy')</p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)"> </span></p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)">Tomas</span></p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)"> </span></p>
<div style="border-style:solid none none;border-color:-moz-use-text-color;border-width:1pt medium medium;padding:3pt 0in 0in">
<p><b><span style="font-size:10pt">From:</span></b><span style="font-size:10pt"> <a href="mailto:ironruby-core-bounces@rubyforge.org" target="_blank">ironruby-core-bounces@rubyforge.org</a>
[mailto:<a href="mailto:ironruby-core-bounces@rubyforge.org" target="_blank">ironruby-core-bounces@rubyforge.org</a>]
<b>On Behalf Of </b>Ivan Porto Carrero<br>
<b>Sent:</b> Monday, December 08, 2008 9:46 AM</span></p>
<div>
<p><span style="font-size:10pt"><br>
<b>To:</b> <a href="mailto:ironruby-core@rubyforge.org" target="_blank">ironruby-core@rubyforge.org</a></span></p>
</div>
<p><b><span style="font-size:10pt">Subject:</span></b><span style="font-size:10pt"> Re: [Ironruby-core] Handling C# lower case namespaces</span></p>
</div>
<div>
<div>
<p> </p>
<p style="margin-bottom:12pt">I get the same behavior.<br>
I can load types from the CLR but not from my own assembly.<br>
<br>
I copied my assembly into the folder that contains ir.exe<br>
<br>
>>> require 'mscorlib'<br>
=> true<br>
>>> require 'IronNails.Library, Version=<a href="http://1.0.0.0" target="_blank">1.0.0.0</a>, Culture=neutral, PublicKeyToken=null'<br>
=> true<br>
>>> IronNails::View::XamlProxy<br>
=> IronNails::View::XamlProxy<br>
>>> System::Type.get_type 'IronNails.View.XamlProxy'<br>
=> nil<br>
>>> System::Type.get_type 'System.String'<br>
=> #<System::RuntimeType:0x000005c><br>
>>> IronNails::View::XamlProxy.to_clr_type<br>
=> #<System::RuntimeType:0x000005e><br clear="all">
<br>
<br>
</p>
<div>
<p>On Mon, Dec 8, 2008 at 5:54 PM, Aaron Feng <<a href="mailto:aaron.feng@gmail.com" target="_blank">aaron.feng@gmail.com</a>>
wrote:</p>
<p style="margin-bottom:12pt">Tomas,<br>
<br>
I tried it again. I couldn't get the following to work with my own DLL
even If I capitalize the namespace (It does work fine with build in types like
System.String):<br>
<br>
> <span style="font-size:11pt;color:rgb(31, 73, 125)">System::Type.get_type("Abc.Hi,
Version=<a href="http://1.0.0.0" target="_blank">1.0.0.0</a>, Culture=neutral,
PublicKeyToken=null")<br>
<br>
</span>Do I have any other options?<br>
<br>
Thanks,</p><div class="Ih2E3d"><br>
<span style="color:rgb(136, 136, 136)"><br>
Aaron<br>
</span><br>
_______________________________________________<br>
Ironruby-core mailing list<br>
<a href="mailto:Ironruby-core@rubyforge.org" target="_blank">Ironruby-core@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/ironruby-core" target="_blank">http://rubyforge.org/mailman/listinfo/ironruby-core</a></div><p></p>
</div>
<p> </p>
</div>
</div>
</div>
</div><div class="Ih2E3d">
<p style="margin-bottom:12pt"><br>
_______________________________________________<br>
Ironruby-core mailing list<br>
<a href="mailto:Ironruby-core@rubyforge.org" target="_blank">Ironruby-core@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/ironruby-core" target="_blank">http://rubyforge.org/mailman/listinfo/ironruby-core</a></p>
</div></div>
<p> </p>
</div></div></div>
</div><div class="Ih2E3d">
<br>_______________________________________________<br>
Ironruby-core mailing list<br>
<a href="mailto:Ironruby-core@rubyforge.org" target="_blank">Ironruby-core@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/ironruby-core" target="_blank">http://rubyforge.org/mailman/listinfo/ironruby-core</a><br>
<br></div></blockquote></div><br>
<br>_______________________________________________<br>
Ironruby-core mailing list<br>
<a href="mailto:Ironruby-core@rubyforge.org">Ironruby-core@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/ironruby-core" target="_blank">http://rubyforge.org/mailman/listinfo/ironruby-core</a><br>
<br></blockquote></div><br></div>