- Decompiler vs having source<DIV>One of the big reasons it's cool to have the source code for something you're working with is so you can see what it's doing. (How often do most people actually modify the source code to an open source program or library? Very rarely compared to how often you use it). But what if you could see what it's doing without having the source?</DIV>
<DIV> </DIV>
<DIV><A href="http://www.aisto.com/roeder/dotnet/Download.aspx?File=Reflector.zip">http://www.aisto.com/roeder/dotnet/Download.aspx?File=Reflector.zip</A></DIV>
<DIV> </DIV>
<DIV>Reflector now has a C# code generator, that generates C# code based on the IL it finds. It works amazingly well. </DIV>
<DIV> </DIV>
<DIV>
<TABLE style="MARGIN-BOTTOM: 0px" cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px" vAlign=top colSpan=2><FONT color=#1000a0>private</FONT> <A title=System.Void href="urn:object:1"><FONT color=#006018>void</FONT></A> <B>CheckScope</B>(<A title=System.Xml.Serialization.TypeScope href="urn:object:2"><FONT color=#006018>TypeScope</FONT></A> scope)<BR>{<BR>
<TABLE cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD width=20>
<TD><FONT color=#1000a0>if</FONT> (<FONT color=#1000a0>this</FONT>.<A title="TypeScope System.Xml.Serialization.XmlCodeExporter.scope;" href="urn:object:3"><FONT color=#006018>scope</FONT></A> == <FONT color=#800000>null</FONT>)<BR>{<BR>
<TABLE cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD width=20>
<TD><FONT color=#1000a0>this</FONT>.<A title="TypeScope System.Xml.Serialization.XmlCodeExporter.scope;" href="urn:object:4"><FONT color=#006018>scope</FONT></A> = <A title="TypeScope scope; // Parameter"><FONT color=#006018>scope</FONT></A>;<BR><FONT color=#1000a0>return</FONT>;</TD></TR></TBODY></TABLE>}<BR><FONT color=#1000a0>if</FONT> (<FONT color=#1000a0>this</FONT>.<A title="TypeScope System.Xml.Serialization.XmlCodeExporter.scope;" href="urn:object:5"><FONT color=#006018>scope</FONT></A> != <A title="TypeScope scope; // Parameter"><FONT color=#006018>scope</FONT></A>)<BR>{<BR>
<TABLE cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD width=20>
<TD><FONT color=#1000a0>throw</FONT> <FONT color=#1000a0>new</FONT> <A title=System.InvalidOperationException.InvalidOperationException(string); href="urn:object:6"><FONT color=#006018>InvalidOperationException</FONT></A>(<A title=System.Xml.Res href="urn:object:7"><FONT color=#006018>Res</FONT></A>.<A title="string System.Xml.Res.GetString(string name);" href="urn:object:8"><FONT color=#006018>GetString</FONT></A>(<FONT color=#800000>"XmlMappingsScopeMismatch"</FONT>));</TD></TR></TBODY></TABLE>}</TD></TR></TBODY></TABLE>}</TD></TR></TBODY></TABLE></DIV>
<DIV> </DIV>
<DIV>That's code generated by the decompiler. It's awesome for answering “I wonder what CheckScope does..“</DIV>
<DIV> </DIV>Thu, 01 Sep 2005 19:17:07 GMT