public override void Create(DecompileContext ctx) { using (var writer = new StreamWriter(Filename, false, Encoding.UTF8)) { var output = new PlainTextOutput(writer); language.Decompile(DecompilationType.AssemblyInfo, new DecompileAssemblyInfo(module, output, decompilationContext)); } }
public override void Create(DecompileContext ctx) { using (var writer = new StreamWriter(Filename, false, Encoding.UTF8)) { var output = new PlainTextOutput(writer); Decompile(ctx, output); } }
string TypeToString(ITypeDefOrRef type, bool includeNamespace, IHasCustomAttribute typeAttributes = null) { var writer = new StringWriter(); var output = new PlainTextOutput(writer); TypeToString(output, type, includeNamespace, typeAttributes); return writer.ToString(); }
public override void Create(DecompileContext ctx) { using (var writer = new StreamWriter(Filename, false, Encoding.UTF8)) { if (winFormsFile.Language.CanDecompile(DecompilationType.PartialType)) { var output = new PlainTextOutput(writer); var opts = new DecompilePartialType(winFormsFile.Type, output, winFormsFile.DecompilationContext); foreach (var d in winFormsFile.GetDefsToRemove()) opts.Definitions.Add(d); opts.ShowDefinitions = true; opts.UseUsingDeclarations = false; winFormsFile.Language.Decompile(DecompilationType.PartialType, opts); } } }
DecompileContext CreateDecompileContext(string filename) { var decompileContext = new DecompileContext(); try { var decompilationContext = new DecompilationContext(); decompileContext.Writer = new StreamWriter(filename); var output = new PlainTextOutput(decompileContext.Writer); var dispatcher = Dispatcher.CurrentDispatcher; decompileContext.DecompileNodeContext = new DecompileNodeContext(decompilationContext, language, output, dispatcher); return decompileContext; } catch { decompileContext.Dispose(); throw; } }
public override string ToString(CancellationToken token, bool canDecompile) { if (!canDecompile) return null; var output = new PlainTextOutput(); Decompile(output, token); return output.ToString(); }
Stream GetDecompiledStream(CancellationToken token) { var output = new PlainTextOutput(); Decompile(output, token); return ResourceUtils.StringToStream(output.ToString()); }