예제 #1
0
        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());
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
		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;
			}
		}