-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: spark
Message 2 in Discussion
i have
tried answering your questions but i really like your observation. actually it
left me lklaughing for a while, even redmind copy-pastes ...
:))
just
for the kicks here is decompilation of the method... you get at the source very
correctly indeed.. :)
rosh
public
static string MethodToString(MethodBase Method) {
bool
local0;
System.Reflection.MethodInfo[] local1;
string
local2;
MethodInfo local3;
ParameterInfo local4;
Type
local5;
object[] local6;
object local7;
Type
local8;
int local9;
System.Reflection.ParameterInfo[]
local10;
local3 = (MethodInfo) Method;
local5 =
local3.ReturnType;
if (local3.Attributes & 64 != 0 &&
!(local3.DeclaringType.IsInterface))
local2 = local2 + "Overrides
";
if (local3.IsPublic)
local2 = local2 + "Public
";
else {
if
(local3.IsPrivate)
local2 = local2 + "Private
";
else if
(local3.IsPrivate)
local2 = local2 + "Friend
";
}
if (local5 == null || local5 ==
Utils.VoidType)
local2 = local2 + "Sub
";
else
local2 = local2 + "Function ";
local2 =
local2 + local3.Name;
local2 = local2 + " (";
foreach
(ParameterInfo local4 in true) {
if
(!(local0))
local2 = local2 + ", ";
else
{
local0 = false;
local2 = local2 + "
";
}
if
(local4.IsOptional)
local2 = local2 + "Optional
";
if (local4.ParameterType.IsByRef)
local2
= local2 + "ByRef ";
else {
local2 = local2
+ "ByVal ";
if (local4.ParameterType.IsArray)
{
local6 =
local4.GetCustomAttributes(typeof(ParamArrayAttribute),
false);
if (local6 != null && local6.Length
> 0)
local2 = local2 + "ParamArray
";
}
}
local2 = local2 +
local4.Name;
local2 = local2 + " As ";
if
(local4.ParameterType.IsByRef)
local2 = local2 +
Utils.VBFriendlyNameOfTypeName(local4.ParameterType.GetElementType().FullName);
else
local2
= local2 +
Utils.VBFriendlyNameOfTypeName(local4.ParameterType.FullName);
if
(local4.IsOptional) {
local7 =
local4.DefaultValue;
if (local7 == null)
{
local8 =
typeof(Object);
break;
}
local8
= local7.GetType();
if (local8 != Utils.VoidType)
{
if (typeof(Enum).IsAssignableFrom(local8))
{
local2 = local2 + " =
";
local2 = local2 + Enum.GetName(local8,
local7);
break;
}
local2
= local2 + " = ";
local2 = local2 +
StringType.FromObject(local7);
}
}
}
local2
= local2 + " )";
if (local5 != null && local5 !=
Utils.VoidType) {
local2 = local2 + " As ";
local2
= local2 +
Utils.VBFriendlyNameOfTypeName(local5.FullName);
}
return
local2;
}
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]