public override ICodeNode VisitMethodReferenceExpression(MethodReferenceExpression node) { V_0 = node.get_Method().Resolve(); V_1 = this.context.get_TypeContext().get_CurrentType(); if (V_0 == null || (object)V_0.get_DeclaringType() != (object)V_1 && !V_0.get_DeclaringType().IsNestedIn(V_1)) { return(this.VisitMethodReferenceExpression(node)); } if (V_0.get_IsGetter() || V_0.get_IsSetter() || !V_0.IsCompilerGenerated(true) && !this.CheckTypeForCompilerGeneratedAttribute(V_0.get_DeclaringType())) { return(this.VisitMethodReferenceExpression(node)); } V_2 = null; if (V_0.get_Body() != null) { V_5 = this.CreateDecompilationContext(V_0); V_2 = V_0.get_Body().DecompileLambda(this.context.get_Language(), V_5); if (V_2.get_Statements().get_Count() == 1 && V_2.get_Statements().get_Item(0).get_CodeNodeType() == 5 && (V_2.get_Statements().get_Item(0) as ExpressionStatement).get_Expression().get_CodeNodeType() == 57) { V_6 = (V_2.get_Statements().get_Item(0) as ExpressionStatement).get_Expression() as ReturnExpression; V_7 = new ShortFormReturnExpression(V_6.get_Value(), V_6.get_MappedInstructions()); V_2 = new BlockStatement(); V_2.get_Statements().Add(new ExpressionStatement(V_7)); } this.context.get_MethodContext().get_VariableDefinitionToNameMap().AddRange <VariableDefinition, string>(V_5.get_MethodContext().get_VariableDefinitionToNameMap()); this.context.get_MethodContext().get_VariableNamesCollection().UnionWith(V_5.get_MethodContext().get_VariableNamesCollection()); this.context.get_MethodContext().AddInnerMethodParametersToContext(V_5.get_MethodContext()); this.context.get_MethodContext().get_GotoStatements().AddRange(V_5.get_MethodContext().get_GotoStatements()); this.context.get_MethodContext().get_GotoLabels().AddRange <string, Statement>(V_5.get_MethodContext().get_GotoLabels()); } V_3 = new ExpressionCollection(); V_4 = LambdaExpressionsHelper.HasAnonymousParameter(V_0.get_Parameters()); V_8 = V_0.get_Parameters().GetEnumerator(); try { while (V_8.MoveNext()) { V_9 = V_8.get_Current(); V_3.Add(new LambdaParameterExpression(V_9, !V_4, null)); } } finally { V_8.Dispose(); } return(new LambdaExpression(V_3, V_2, V_0.IsAsync(), V_0.IsFunction(), node.get_Method().get_Parameters(), false, node.get_MappedInstructions())); }
public static bool IsCompilerGeneratedDelegate(this FieldReference fieldReference) { if (!fieldReference.get_IsDefinition()) { V_0 = fieldReference.Resolve(); } else { V_0 = (FieldDefinition)fieldReference; } if (V_0 == null) { return false; } V_1 = V_0.IsCompilerGenerated(true); if (!V_0.get_FieldType().get_IsDefinition()) { V_3 = V_0.get_FieldType().Resolve(); } else { V_3 = (TypeDefinition)V_0.get_FieldType(); } if (V_3 == null) { V_2 = null; } else { V_2 = V_3.get_BaseType(); } if (!V_1 || V_2 == null) { return false; } return String.op_Equality(V_2.get_FullName(), Type.GetTypeFromHandle(// // Current member / type: System.Boolean Mono.Cecil.Extensions.FieldReferenceExtensions::IsCompilerGeneratedDelegate(Mono.Cecil.FieldReference) // Exception in: System.Boolean IsCompilerGeneratedDelegate(Mono.Cecil.FieldReference) // Specified method is not supported. // // mailto: [email protected] }