Browse Source

Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger

pull/191/merge
Eusebiu Marcu 15 years ago
parent
commit
c7c7f4cc61
  1. 8
      ICSharpCode.Decompiler/Ast/Transforms/DelegateConstruction.cs
  2. 2
      ICSharpCode.Decompiler/Ast/Transforms/PatternStatementTransform.cs
  3. 5
      ICSharpCode.Decompiler/Tests/DelegateConstruction.cs
  4. BIN
      ILSpy/Images/ILSpy.ico
  5. 5
      ILSpy/MainWindow.xaml.cs

8
ICSharpCode.Decompiler/Ast/Transforms/DelegateConstruction.cs

@ -177,7 +177,7 @@ namespace ICSharpCode.Decompiler.Ast.Transforms
static bool IsPotentialClosure(DecompilerContext context, TypeDefinition potentialDisplayClass) static bool IsPotentialClosure(DecompilerContext context, TypeDefinition potentialDisplayClass)
{ {
if (potentialDisplayClass == null || !potentialDisplayClass.IsCompilerGenerated()) if (potentialDisplayClass == null || !potentialDisplayClass.IsCompilerGeneratedOrIsInCompilerGeneratedClass())
return false; return false;
// check that methodContainingType is within containingType // check that methodContainingType is within containingType
while (potentialDisplayClass != context.CurrentType) { while (potentialDisplayClass != context.CurrentType) {
@ -293,7 +293,13 @@ namespace ICSharpCode.Decompiler.Ast.Transforms
if (!ok) if (!ok)
continue; continue;
Dictionary<FieldReference, AstNode> dict = new Dictionary<FieldReference, AstNode>(); Dictionary<FieldReference, AstNode> dict = new Dictionary<FieldReference, AstNode>();
// Delete the variable declaration statement: // Delete the variable declaration statement:
VariableDeclarationStatement displayClassVarDecl = PatternStatementTransform.FindVariableDeclaration(stmt, variable.Name);
if (displayClassVarDecl != null)
displayClassVarDecl.Remove();
// Delete the assignment statement:
AstNode cur = stmt.NextSibling; AstNode cur = stmt.NextSibling;
stmt.Remove(); stmt.Remove();

2
ICSharpCode.Decompiler/Ast/Transforms/PatternStatementTransform.cs

@ -201,7 +201,7 @@ namespace ICSharpCode.Decompiler.Ast.Transforms
return null; return null;
} }
VariableDeclarationStatement FindVariableDeclaration(AstNode node, string identifier) internal static VariableDeclarationStatement FindVariableDeclaration(AstNode node, string identifier)
{ {
while (node != null) { while (node != null) {
while (node.PrevSibling != null) { while (node.PrevSibling != null) {

5
ICSharpCode.Decompiler/Tests/DelegateConstruction.cs

@ -157,4 +157,9 @@ public static class DelegateConstruction
} }
}; };
} }
public static Func<int, Func<int, int>> CurriedAddition(int a)
{
return b => c => a + b + c;
}
} }

BIN
ILSpy/Images/ILSpy.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 84 KiB

5
ILSpy/MainWindow.xaml.cs

@ -73,10 +73,7 @@ namespace ICSharpCode.ILSpy
this.sessionSettings = new SessionSettings(spySettings); this.sessionSettings = new SessionSettings(spySettings);
this.assemblyListManager = new AssemblyListManager(spySettings); this.assemblyListManager = new AssemblyListManager(spySettings);
if (Environment.OSVersion.Version.Major >= 6) this.Icon = new BitmapImage(new Uri("pack://application:,,,/ILSpy;component/images/ILSpy.ico"));
this.Icon = new BitmapImage(new Uri("pack://application:,,,/ILSpy;component/images/ILSpy.ico"));
else
this.Icon = Images.AssemblyLoading;
this.DataContext = sessionSettings; this.DataContext = sessionSettings;
this.Left = sessionSettings.WindowBounds.Left; this.Left = sessionSettings.WindowBounds.Left;

Loading…
Cancel
Save