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. 3
      ILSpy/MainWindow.xaml.cs

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

@ -177,7 +177,7 @@ namespace ICSharpCode.Decompiler.Ast.Transforms @@ -177,7 +177,7 @@ namespace ICSharpCode.Decompiler.Ast.Transforms
static bool IsPotentialClosure(DecompilerContext context, TypeDefinition potentialDisplayClass)
{
if (potentialDisplayClass == null || !potentialDisplayClass.IsCompilerGenerated())
if (potentialDisplayClass == null || !potentialDisplayClass.IsCompilerGeneratedOrIsInCompilerGeneratedClass())
return false;
// check that methodContainingType is within containingType
while (potentialDisplayClass != context.CurrentType) {
@ -293,7 +293,13 @@ namespace ICSharpCode.Decompiler.Ast.Transforms @@ -293,7 +293,13 @@ namespace ICSharpCode.Decompiler.Ast.Transforms
if (!ok)
continue;
Dictionary<FieldReference, AstNode> dict = new Dictionary<FieldReference, AstNode>();
// 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;
stmt.Remove();

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

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

5
ICSharpCode.Decompiler/Tests/DelegateConstruction.cs

@ -157,4 +157,9 @@ public static class DelegateConstruction @@ -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

3
ILSpy/MainWindow.xaml.cs

@ -73,10 +73,7 @@ namespace ICSharpCode.ILSpy @@ -73,10 +73,7 @@ namespace ICSharpCode.ILSpy
this.sessionSettings = new SessionSettings(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"));
else
this.Icon = Images.AssemblyLoading;
this.DataContext = sessionSettings;
this.Left = sessionSettings.WindowBounds.Left;

Loading…
Cancel
Save