private string GetField(IField field) { IDecompilerOutput output; var stringBuilder = new StringBuilder(); var writer = new StringWriter(stringBuilder); output = new TextWriterDecompilerOutput(writer); DisassemblerHelpers.WriteFieldTo(field, output); return(output.ToString()); }
DecompileContext CreateDecompileContext(string filename) { var decompileContext = new DecompileContext(); try { var decompilationContext = new DecompilationContext(); decompileContext.Writer = new StreamWriter(filename); var output = new TextWriterDecompilerOutput(decompileContext.Writer); var dispatcher = Dispatcher.CurrentDispatcher; decompileContext.DecompileNodeContext = new DecompileNodeContext(decompilationContext, decompiler, output, NullDocumentWriterService.Instance, dispatcher); return(decompileContext); } catch { decompileContext.Dispose(); throw; } }
DecompileContext CreateDecompileContext(string filename) { var decompileContext = new DecompileContext(); try { var decompilationContext = new DecompilationContext(); decompileContext.Writer = new StreamWriter(filename); var output = new TextWriterDecompilerOutput(decompileContext.Writer); var dispatcher = Dispatcher.CurrentDispatcher; decompileContext.DecompileNodeContext = new DecompileNodeContext(decompilationContext, decompiler, output, NullDocumentWriterService.Instance, dispatcher); return decompileContext; } catch { decompileContext.Dispose(); throw; } }