Exemplo n.º 1
0
		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));
			}
		}
Exemplo n.º 2
0
		public override void Create(DecompileContext ctx) {
			using (var writer = new StreamWriter(Filename, false, Encoding.UTF8)) {
				var output = new PlainTextOutput(writer);
				Decompile(ctx, output);
			}
		}
Exemplo n.º 3
0
		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();
		}
Exemplo n.º 4
0
		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);
				}
			}
		}
Exemplo n.º 5
0
 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;
     }
 }
Exemplo n.º 6
0
		public override string ToString(CancellationToken token, bool canDecompile) {
			if (!canDecompile)
				return null;
			var output = new PlainTextOutput();
			Decompile(output, token);
			return output.ToString();
		}
Exemplo n.º 7
0
		Stream GetDecompiledStream(CancellationToken token) {
			var output = new PlainTextOutput();
			Decompile(output, token);
			return ResourceUtils.StringToStream(output.ToString());
		}