示例#1
0
        private BlockStatement FinishDecompilationOfMethod(BlockStatement block, DecompilationContext context, out MethodSpecificContext methodContext)
        {
            methodContext = null;

            BlockStatement fullyDecompiledBlock;

            try
            {
                BlockDecompilationPipeline pipeline = this.language.CreatePropertyPipeline(context.MethodContext.Method, context);

                methodContext = pipeline.Run(context.MethodContext.Method.Body, block, this.language).MethodContext;

                fullyDecompiledBlock = pipeline.Body;
            }
            catch (Exception ex)
            {
                this.ExceptionsWhileDecompiling.Add(context.MethodContext.Method);

                methodContext = new MethodSpecificContext(context.MethodContext.Method.Body);

                fullyDecompiledBlock = new BlockStatement();
                fullyDecompiledBlock.AddStatement(new ExceptionStatement(ex, context.MethodContext.Method));

                OnExceptionThrown(ex);
            }

            return(fullyDecompiledBlock);
        }
 // This pipeline is used by the PropertyDecompiler to finish the decompilation of properties, which are partially decompiled
 // using the steps from the IntermediateRepresenationPipeline.
 public virtual BlockDecompilationPipeline CreatePropertyPipeline(DecompilationContext context)
 {
     BlockDecompilationPipeline result = new BlockDecompilationPipeline(LanguageDecompilationSteps(false), context);
     return result;
 }
 // This pipeline is used by the PropertyDecompiler to finish the decompilation of properties, which are partially decompiled
 // using the steps from the IntermediateRepresenationPipeline.
 public virtual BlockDecompilationPipeline CreatePropertyPipeline(MethodDefinition method, DecompilationContext context)
 {
     BlockDecompilationPipeline result = new BlockDecompilationPipeline(new IDecompilationStep[0], context);
     return result;
 }