Browse Source

use string instead of StringWriter

newNRILSpyDebugger
Siegfried Pammer 12 years ago
parent
commit
8e8c5db87d
  1. 8
      src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyUnresolvedFile.cs
  2. 8
      src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs

8
src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyUnresolvedFile.cs

@ -20,7 +20,7 @@ namespace ICSharpCode.ILSpyAddIn @@ -20,7 +20,7 @@ namespace ICSharpCode.ILSpyAddIn
public class ILSpyUnresolvedFile : CSharpUnresolvedFile
{
DecompiledTypeReference name;
StringWriter writer;
string output;
public static ILSpyUnresolvedFile Create(DecompiledTypeReference name, AstBuilder builder)
{
@ -38,7 +38,7 @@ namespace ICSharpCode.ILSpyAddIn @@ -38,7 +38,7 @@ namespace ICSharpCode.ILSpyAddIn
file.MemberLocations = output.MemberLocations;
file.DebugSymbols = output.DebugSymbols;
file.writer = writer;
file.output = writer.ToString();
return file;
}
@ -53,8 +53,8 @@ namespace ICSharpCode.ILSpyAddIn @@ -53,8 +53,8 @@ namespace ICSharpCode.ILSpyAddIn
public Dictionary<string, MethodDebugSymbols> DebugSymbols { get; private set; }
public StringWriter Writer {
get { return writer; }
public string Output {
get { return output; }
}
public FileName AssemblyFile {

8
src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs

@ -179,7 +179,7 @@ namespace ICSharpCode.ILSpyAddIn @@ -179,7 +179,7 @@ namespace ICSharpCode.ILSpyAddIn
var file = ILSpyDecompilerService.DecompileType(DecompiledTypeName);
memberLocations = file.MemberLocations;
DebugSymbols = file.DebugSymbols;
OnDecompilationFinished(file.Writer);
OnDecompilationFinished(file.Output);
} catch (OperationCanceledException) {
// ignore cancellation
} catch (Exception ex) {
@ -193,15 +193,15 @@ namespace ICSharpCode.ILSpyAddIn @@ -193,15 +193,15 @@ namespace ICSharpCode.ILSpyAddIn
writer.WriteLine(string.Format("Exception while decompiling {0} ({1})", DecompiledTypeName.Type, DecompiledTypeName.AssemblyFile));
writer.WriteLine();
writer.WriteLine(ex.ToString());
SD.MainThread.InvokeAsyncAndForget(() => OnDecompilationFinished(writer));
SD.MainThread.InvokeAsyncAndForget(() => OnDecompilationFinished(writer.ToString()));
}
}
void OnDecompilationFinished(StringWriter output)
void OnDecompilationFinished(string output)
{
if (cancellation.IsCancellationRequested)
return;
codeEditor.Document.Text = output.ToString();
codeEditor.Document.Text = output;
codeEditor.Document.UndoStack.ClearAll();
this.decompilationFinished = true;

Loading…
Cancel
Save