I am attempting to recover source from an assembly using Reg Gate's Reflector. The original source took advantage of several C# 3.0 features which has made it a little difficult to recover. For instance here is the recovered source for an anonymous type. The first thing that pops out is the <> in from on the class identifier. Run time type naming rules are apparently more liberal than design time rules. Fair enough. A simple search and replace will fix that. What other compiler manglings must I look out for and how do I deal with them?
[DebuggerDisplay(@"\{ OverrideType = {OverrideType}, EntityType = {EntityType} }", Type="<Anonymous Type>"), CompilerGenerated]
internal sealed class <>f__AnonymousType1<<OverrideType>j__TPar, <EntityType>j__TPar>
{
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly <EntityType>j__TPar <EntityType>i__Field;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly <OverrideType>j__TPar <OverrideType>i__Field;
[DebuggerHidden]
public <>f__AnonymousType1(<OverrideType>j__TPar OverrideType, <EntityType>j__TPar EntityType)
{
this.<OverrideType>i__Field = OverrideType;
this.<EntityType>i__Field = EntityType;
}
[DebuggerHidden]
public override bool Equals(object value)
{
var type = value as <>f__AnonymousType1<<OverrideType>j__TPar, <EntityType>j__TPar>;
return (((type != null) && EqualityComparer<> <<OverrideType>j__TPar>.Default.Equals(this.<OverrideType>i__Field, type.<OverrideType>i__Field)) && EqualityComparer<<EntityType>j__TPar>.Default.Equals(this.<EntityType>i__Field, type.<EntityType>i__Field));
}
[DebuggerHidden]
public override int GetHashCode()
{
int num = -338316509;
num = (-1521134295 * num) + EqualityComparer<<OverrideType>j__TPar>.Default.GetHashCode(this.<OverrideType>i__Field);
return ((-1521134295 * num) + EqualityComparer<<EntityType>j__TPar>.Default.GetHashCode(this.<EntityType>i__Field));
}
[DebuggerHidden]
public override string ToString()
{
StringBuilder builder = new StringBuilder();
builder.Append("{ OverrideType = ");
builder.Append(this.<OverrideType>i__Field);
builder.Append(", EntityType = ");
builder.Append(this.<EntityType>i__Field);
builder.Append(" }");
return builder.ToString();
}
public <EntityType>j__TPar EntityType
{
get
{
return this.<EntityType>i__Field;
}
}
public <OverrideType>j__TPar OverrideType
{
get
{
return this.<OverrideType>i__Field;
}
}
}