private TypeReference GetUseInMethodInvocation(MethodInvocationExpression methodInvocationExpression, VariableReference variable) { V_0 = null; V_1 = methodInvocationExpression.get_Arguments().GetEnumerator(); try { while (V_1.MoveNext()) { V_2 = V_1.get_Current(); if (V_2 as VariableReferenceExpression == null || (object)(V_2 as VariableReferenceExpression).get_Variable() != (object)variable) { continue; } V_0 = V_2; } } finally { if (V_1 != null) { V_1.Dispose(); } } if (V_0 == null) { if ((object)(methodInvocationExpression.get_MethodExpression().get_Target() as VariableReferenceExpression).get_Variable() != (object)variable) { return(null); } return(methodInvocationExpression.get_MethodExpression().get_Member().get_DeclaringType()); } V_3 = methodInvocationExpression.get_Arguments().IndexOf(V_0); V_4 = methodInvocationExpression.get_MethodExpression().get_Method(); return(V_4.get_Parameters().get_Item(V_3).ResolveParameterType(V_4)); }
public override void VisitMethodInvocationExpression(MethodInvocationExpression node) { V_0 = node.get_MethodExpression().get_MethodDefinition(); if (V_0 == null) { this.VisitMethodInvocationExpression(node); return; } this.Visit(node.get_MethodExpression()); V_1 = 0; while (V_1 < node.get_Arguments().get_Count()) { V_2 = node.get_Arguments().get_Item(V_1) as UnaryExpression; if (V_0.get_Parameters().get_Item(V_1).IsOutParameter() && V_2 != null && V_2.get_Operator() == 7 && this.CheckExpression(V_2.get_Operand()) || this.CheckExpression(node.get_Arguments().get_Item(V_1))) { this.searchResult = 1; return; } this.Visit(node.get_Arguments().get_Item(V_1)); if (this.searchResult != UsageFinderSearchResult.NotFound) { return; } V_1 = V_1 + 1; } return; }
public override ICodeNode VisitMethodInvocationExpression(MethodInvocationExpression node) { node.set_MethodExpression((MethodReferenceExpression)this.Visit(node.get_MethodExpression())); if (this.status != SimpleVariableInliner.InliningResult.NotFound) { return(node); } V_0 = node.get_MethodExpression().get_Method(); V_1 = 0; while (V_1 < node.get_Arguments().get_Count()) { if (V_0.get_Parameters().get_Item(V_1).get_ParameterType().get_IsByReference()) { if (this.valueHasSideEffects && (new SideEffectsFinder()).HasSideEffectsRecursive(node.get_Arguments().get_Item(V_1))) { this.status = 2; return(node); } } else { node.get_Arguments().set_Item(V_1, (Expression)this.Visit(node.get_Arguments().get_Item(V_1))); if (this.status != SimpleVariableInliner.InliningResult.NotFound) { return(node); } } V_1 = V_1 + 1; } return(node); }
public override void VisitMethodInvocationExpression(MethodInvocationExpression node) { V_0 = node.get_MethodExpression().get_MethodDefinition(); if (V_0 == null) { this.VisitMethodInvocationExpression(node); return; } this.Visit(node.get_MethodExpression()); V_1 = 0; while (V_1 < node.get_Arguments().get_Count()) { V_2 = node.get_Arguments().get_Item(V_1) as UnaryExpression; if (V_2 == null || V_2.get_Operator() != 7 || V_2.get_Operand().get_CodeNodeType() != 26 || !V_0.get_Parameters().get_Item(V_1).IsOutParameter()) { this.Visit(node.get_Arguments().get_Item(V_1)); } else { V_3 = (V_2.get_Operand() as VariableReferenceExpression).get_Variable(); if (!this.variableReferences.ContainsKey(V_3)) { this.variableReferences.Add(V_3, true); } } V_1 = V_1 + 1; } return; }
public override ICodeNode VisitMethodInvocationExpression(MethodInvocationExpression node) { if (node.get_MethodExpression().get_Target() != null && node.get_MethodExpression().get_Target().get_CodeNodeType() == 28) { return(null); } return(this.VisitMethodInvocationExpression(node)); }
public override void VisitMethodInvocationExpression(MethodInvocationExpression node) { this.VisitMethodInvocationExpression(node); if (node.get_MethodExpression().get_CodeNodeType() == 20) { this.FixArguments(node.get_MethodExpression().get_Method(), node.get_Arguments()); } return; }
public ICodeNode VisitMethodInvocationExpression(MethodInvocationExpression node) { if (node.get_MethodExpression() == null) { return(null); } V_0 = node.get_MethodExpression(); V_1 = V_0.get_Method(); if (V_1.get_Name() == null) { return(null); } V_2 = this.GetEventMethodPrefix(V_1.get_Name()); if (String.IsNullOrEmpty(V_2)) { return(null); } if (V_1.get_Parameters().get_Count() != 1) { return(null); } V_3 = V_1.get_DeclaringType(); V_4 = null; do { V_6 = new RebuildEventsStep.u003cu003ec__DisplayClass2_0(); if (V_3 == null) { break; } V_7 = V_3.Resolve(); if (V_7 == null) { break; } V_6.eventName = V_1.get_Name().Substring(V_2.get_Length()); V_4 = V_7.get_Events().FirstOrDefault <EventDefinition>(new Func <EventDefinition, bool>(V_6.u003cVisitMethodInvocationExpressionu003eb__0)); if (V_4 != null) { continue; } V_3 = V_7.get_BaseType(); }while (V_3 != null && V_4 == null); if (V_4 == null) { return(null); } V_5 = new EventReferenceExpression(V_0.get_Target(), V_4, null); return(this.GetEventAssignExpression(V_5, node.get_Arguments().get_Item(0), V_2, node.get_InvocationInstructions())); }
public override ICodeNode VisitMethodInvocationExpression(MethodInvocationExpression node) { node = (MethodInvocationExpression)this.VisitMethodInvocationExpression(node); this.VisitInvocationArguments(node.get_Arguments(), node.get_MethodExpression().get_Method()); if (node.get_IsConstrained() && node.get_MethodExpression().get_Target().get_CodeNodeType() == 22) { V_0 = node.get_ConstraintType().Resolve(); if (V_0.get_IsEnum()) { node.get_MethodExpression().set_Target(EnumHelper.GetEnumExpression(V_0, node.get_MethodExpression().get_Target() as LiteralExpression, this.typeSystem)); } } return(node); }
public ICodeNode VisitMethodInvocationExpression(MethodInvocationExpression node) { if (node.get_MethodExpression().get_CodeNodeType() == 20) { V_0 = node.get_MethodExpression(); V_1 = V_0.get_Method(); if (this.IsDelegateInvokeMethod(V_1)) { V_2 = (ExpressionCollection)this.codeTransformer.Visit(node.get_Arguments()); return(new DelegateInvokeExpression(V_0.get_Target(), V_2, V_1, node.get_InvocationInstructions())); } } return(null); }
public override void VisitMethodInvocationExpression(MethodInvocationExpression node) { this.Visit(node.get_MethodExpression()); if (node.get_MethodExpression() != null) { this.methodInvocationsStackCount = this.methodInvocationsStackCount + 1; } this.Visit(node.get_Arguments()); if (node.get_MethodExpression() != null) { this.methodInvocationsStackCount = this.methodInvocationsStackCount - 1; } return; }
public ICodeNode VisitMethodInvocationExpression(MethodInvocationExpression node) { V_0 = node.get_MethodExpression(); if (V_0 == null) { return(null); } V_1 = V_0.get_Method() as MethodDefinition; if (V_1 == null) { V_2 = V_0.get_Method(); if (V_2 != null && !String.IsNullOrEmpty(V_2.get_Name()) && V_2.get_Name().StartsWith("set_") || V_2.get_Name().StartsWith("get_") || V_2.get_Name().StartsWith("put_")) { V_1 = V_2.Resolve(); } } if (V_1 == null || !V_1.get_IsGetter() && !V_1.get_IsSetter()) { return(null); } V_3 = new PropertyReferenceExpression(node, null); if (V_3.get_Property() == null) { return(node); } V_4 = V_3; if (V_1.get_IsSetter()) { V_5 = node.get_Arguments().get_Count() - 1; V_4 = new BinaryExpression(26, V_3, node.get_Arguments().get_Item(V_5), this.typeSystem, null, false); } return(V_4); }
public override void VisitMethodInvocationExpression(MethodInvocationExpression node) { this.TrySetMethodInvocationPendingName(node.get_MethodExpression()); this.ClearPendingForSuggestion(); this.VisitMethodInvocationExpression(node); return; }
private bool TryProcessSingleParameterQuery(MethodInvocationExpression methodInvoke, bool canChangeIdentifier, bool queryable, out Expression result) { result = null; V_0 = methodInvoke.get_MethodExpression().get_MethodDefinition(); if (V_0.get_Parameters().get_Count() != 2) { return(false); } V_1 = this.GetFuncGenericInstance(V_0.get_Parameters().get_Item(1).get_ParameterType() as GenericInstanceType, queryable); if (V_1 == null || V_1.get_GenericArguments().get_Count() != 2) { return(false); } V_2 = this.GetLambdaExpression(methodInvoke.get_Arguments().get_Item(1), queryable); if (V_2 == null || V_2.get_Arguments().get_Count() != 1) { return(false); } V_3 = V_2.get_Parameters()[0].Resolve(); if (!canChangeIdentifier) { if (this.currentIdentifier == null) { return(false); } } else { this.ProcessCurrentIdentifier(methodInvoke.get_Arguments().get_Item(0), V_3); } stackVariable49 = new VariableReference[1]; stackVariable49[0] = this.currentIdentifier; result = this.ProcessReturnExpression(V_2, stackVariable49); return(result != null); }
public static bool IsTypeOfExpression(this MethodInvocationExpression self, out TypeReference typeReference) { typeReference = null; V_0 = self.get_MethodExpression(); if (V_0 == null) { return(false); } V_1 = V_0.get_Method(); if (V_1.get_CallingConvention() == 2 || String.op_Inequality(V_1.get_DeclaringType().get_FullName(), "System.Type") || String.op_Inequality(V_1.get_Name(), "GetTypeFromHandle")) { return(false); } if (self.get_Arguments().get_Count() != 1) { return(false); } V_2 = self.get_Arguments().get_Item(0) as MemberHandleExpression; if (V_2 == null) { return(false); } typeReference = V_2.get_MemberReference() as TypeReference; return((object)typeReference != (object)null); }
public override void VisitMethodInvocationExpression(MethodInvocationExpression node) { this.VisitMethodInvocationExpression(node); V_0 = node.get_MethodExpression().get_Method(); this.TraverseMethodParameters(V_0, node.get_Arguments()); return; }
public override ICodeNode VisitMethodInvocationExpression(MethodInvocationExpression node) { if (node.get_MethodExpression().get_Target() as VariableReferenceExpression == null || (object)(node.get_MethodExpression().get_Target() as VariableReferenceExpression).get_Variable() != (object)this.enumerator || !String.op_Equality(node.get_MethodExpression().get_Method().get_Name(), "get_Current")) { return(this.VisitMethodInvocationExpression(node)); } return(new VariableReferenceExpression(this.foreachVariable, null)); }
public override void VisitMethodInvocationExpression(MethodInvocationExpression node) { if (node.get_MethodExpression().get_Target() as VariableReferenceExpression != null && (object)(node.get_MethodExpression().get_Target() as VariableReferenceExpression).get_Variable() == (object)this.enumerator && String.op_Inequality(node.get_MethodExpression().get_Method().get_Name(), "get_Current")) { this.set_IsEnumeratorUsed(true); } this.VisitMethodInvocationExpression(node); return; }
private bool TryMatchLinqQuery(MethodInvocationExpression methodInvocation, out LinqQueryExpression linqQuery) { V_0 = new Stack <MethodInvocationExpression>(); V_1 = methodInvocation; V_2 = V_1.get_MethodExpression().get_MethodDefinition().IsQueryableMethod(); while (V_1 != null && V_1.get_MethodExpression().get_MethodDefinition().IsQueryMethod() && V_2 == V_1.get_MethodExpression().get_MethodDefinition().IsQueryableMethod()) { V_0.Push(V_1); V_1 = V_1.get_Arguments().get_Item(0) as MethodInvocationExpression; } if (V_0.get_Count() == 0) { linqQuery = null; return(false); } V_3 = V_0.Peek(); V_3.get_Arguments().set_Item(0, (Expression)this.Visit(V_3.get_Arguments().get_Item(0))); linqQuery = this.ProcessExtensionMethodChain(V_0, methodInvocation, V_2); return(linqQuery != null); }
private void GetDynamicArgument(MethodInvocationExpression expression, int index, CallSiteInfo callSiteInfo) { if (String.op_Inequality(expression.get_MethodExpression().get_Method().get_Name(), "Create") || expression.get_MethodExpression().get_Target() != null || String.op_Inequality(expression.get_MethodExpression().get_Method().get_DeclaringType().GetFriendlyFullName(null), "Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo") || expression.get_Arguments().get_Count() != 2 || expression.get_Arguments().get_Item(0).get_CodeNodeType() != 22) { throw new Exception("Invalid statement."); } if (Convert.ToInt32((expression.get_Arguments().get_Item(0) as LiteralExpression).get_Value()) & 1 == 0) { callSiteInfo.get_DynamicArgumentIndices().Add(index); } return; }
public override ICodeNode VisitMethodInvocationExpression(MethodInvocationExpression node) { V_0 = node.get_MethodExpression(); if (V_0.get_Target() != null) { if (V_0.get_Target().get_CodeNodeType() == 26 && this.asyncData.get_AwaiterVariables().Contains((V_0.get_Target() as VariableReferenceExpression).get_Variable())) { V_1 = (V_0.get_Target() as VariableReferenceExpression).get_Variable(); if ((object)this.currentAwaiterVariable == (object)V_1) { if (!String.op_Equality(V_0.get_Method().get_Name(), "get_IsCompleted")) { if (String.op_Equality(V_0.get_Method().get_Name(), "GetResult") && this.matcherState & 2 == 2) { this.matcherState = this.matcherState ^ 2; return(new AwaitExpression((Expression)this.Visit(this.awaitedExpression), V_0.get_Method().get_ReturnType(), node.get_UnderlyingSameMethodInstructions())); } } else { if (this.matcherState == 1) { this.matcherState = 6; return(null); } } } this.matcherState = 8; return(node); } if (V_0.get_Target().get_CodeNodeType() == 30 && (object)(V_0.get_Target() as FieldReferenceExpression).get_Field().Resolve() == (object)this.builderField && String.op_Equality(V_0.get_Method().get_Name(), "SetResult")) { if (node.get_Arguments().get_Count() > 0) { stackVariable34 = node.get_Arguments().get_Item(0); } else { stackVariable34 = null; } return(new ReturnExpression(stackVariable34, V_0.get_UnderlyingSameMethodInstructions())); } } return(this.VisitMethodInvocationExpression(node)); }
private bool TryProcessSelectManyMethod(MethodInvocationExpression methodInvoke, bool queryable) { V_0 = methodInvoke.get_MethodExpression().get_MethodDefinition(); if (V_0.get_Parameters().get_Count() != 3) { return(false); } V_1 = this.GetFuncGenericInstance(V_0.get_Parameters().get_Item(1).get_ParameterType() as GenericInstanceType, queryable); if (V_1 == null || V_1.get_GenericArguments().get_Count() != 2) { return(false); } V_2 = this.GetLambdaExpression(methodInvoke.get_Arguments().get_Item(1), queryable); if (V_2 == null || V_2.get_Arguments().get_Count() != 1) { return(false); } this.ProcessCurrentIdentifier(methodInvoke.get_Arguments().get_Item(0), V_2.get_Parameters()[0].Resolve()); stackVariable48 = new VariableReference[1]; stackVariable48[0] = this.currentIdentifier; V_3 = this.ProcessReturnExpression(V_2, stackVariable48); if (V_3 == null) { return(false); } V_4 = this.GetLambdaExpression(methodInvoke.get_Arguments().get_Item(2), queryable); if (V_4 == null || V_4.get_Arguments().get_Count() != 2) { return(false); } V_5 = this.CreateNewIdentifier(V_4.get_Parameters()[1].get_Name(), V_4.get_Parameters()[1].get_ParameterType()); stackVariable82 = new VariableReference[2]; stackVariable82[0] = this.currentIdentifier; stackVariable82[1] = V_5; V_6 = this.ProcessReturnExpression(V_4, stackVariable82); if (V_6 == null) { return(false); } V_7 = this.GetIdentifierReference(V_5, ref V_3); this.clauses.Add(new FromClause(V_7, V_3, null)); this.clauses.Add(new SelectClause(V_6, methodInvoke.get_InvocationInstructions())); this.currentIdentifier = null; return(true); }
private bool TryProcessGroupByMethod(MethodInvocationExpression methodInvoke, bool queryable) { V_0 = methodInvoke.get_MethodExpression().get_MethodDefinition(); if (V_0.get_Parameters().get_Count() > 3 || V_0.get_Parameters().get_Count() != V_0.get_GenericParameters().get_Count() || V_0.get_GenericParameters().get_Count() == 3 && String.op_Inequality(V_0.get_GenericParameters().get_Item(2).get_Name(), "TElement")) { return(false); } V_1 = this.GetLambdaExpression(methodInvoke.get_Arguments().get_Item(1), queryable); if (V_1 == null || V_1.get_Arguments().get_Count() != 1) { return(false); } this.ProcessCurrentIdentifier(methodInvoke.get_Arguments().get_Item(0), V_1.get_Parameters()[0].Resolve()); stackVariable44 = new VariableReference[1]; stackVariable44[0] = this.currentIdentifier; V_2 = this.ProcessReturnExpression(V_1, stackVariable44); if (V_2 == null) { return(false); } if (methodInvoke.get_Arguments().get_Count() != 3) { V_3 = new VariableReferenceExpression(this.currentIdentifier, null); } else { V_4 = this.GetLambdaExpression(methodInvoke.get_Arguments().get_Item(2), queryable); if (V_4 == null || V_4.get_Arguments().get_Count() != 1) { return(false); } stackVariable84 = new VariableReference[1]; stackVariable84[0] = this.currentIdentifier; V_3 = this.ProcessReturnExpression(V_4, stackVariable84); if (V_3 == null) { return(false); } } this.clauses.Add(new GroupClause(V_3, V_2, methodInvoke.get_InvocationInstructions())); this.currentIdentifier = null; return(true); }
public void VisitMethodInvocationExpression(MethodInvocationExpression node) { if (!node.get_VirtualCall()) { V_0 = node.get_MethodExpression(); if (V_0 == null) { return; } if (V_0.get_Target() as ThisReferenceExpression != null) { V_7 = this.method.get_DeclaringType().Resolve(); if (V_7 != null && (object)V_7 != (object)V_0.get_Method().get_DeclaringType().Resolve()) { V_8 = this.method.get_DeclaringType().get_BaseType(); if (V_8 == null || String.op_Equality(V_8.get_FullName(), Type.GetTypeFromHandle(// // Current member / type: System.Void Telerik.JustDecompiler.Steps.HandleVirtualMethodInvocations::VisitMethodInvocationExpression(Telerik.JustDecompiler.Ast.Expressions.MethodInvocationExpression) // Exception in: System.Void VisitMethodInvocationExpression(Telerik.JustDecompiler.Ast.Expressions.MethodInvocationExpression) // Specified method is not supported. // // mailto: [email protected] } }
public override ICodeNode VisitMethodInvocationExpression(MethodInvocationExpression node) { node.set_MethodExpression((MethodReferenceExpression)this.VisitMethodReferenceExpression(node.get_MethodExpression())); node.set_Arguments((ExpressionCollection)this.Visit(node.get_Arguments())); return(node); }
private bool TryProcessJoinMethod(MethodInvocationExpression methodInvoke, bool isGroupJoin, bool queryable) { if (methodInvoke.get_MethodExpression().get_MethodDefinition().get_Parameters().get_Count() != 5) { return(false); } V_0 = (Expression)(new RebuildLinqQueriesStep.LinqQueriesRebuilder(this.methodContext)).Visit(methodInvoke.get_Arguments().get_Item(1).Clone()); V_1 = this.GetLambdaExpression(methodInvoke.get_Arguments().get_Item(2), queryable); if (V_1 == null || V_1.get_Arguments().get_Count() != 1) { return(false); } this.ProcessCurrentIdentifier(methodInvoke.get_Arguments().get_Item(0), V_1.get_Parameters()[0].Resolve()); stackVariable42 = new VariableReference[1]; stackVariable42[0] = this.currentIdentifier; V_2 = this.ProcessReturnExpression(V_1, stackVariable42); if (V_2 == null) { return(false); } V_3 = this.GetLambdaExpression(methodInvoke.get_Arguments().get_Item(3), queryable); if (V_3 == null || V_3.get_Arguments().get_Count() != 1) { return(false); } V_4 = this.CreateNewIdentifier(V_3.get_Parameters()[0].get_Name(), V_3.get_Parameters()[0].get_ParameterType()); stackVariable76 = new VariableReference[1]; stackVariable76[0] = V_4; V_5 = this.ProcessReturnExpression(V_3, stackVariable76); if (V_5 == null) { return(false); } V_6 = this.GetLambdaExpression(methodInvoke.get_Arguments().get_Item(4), queryable); if (V_6 == null || V_6.get_Arguments().get_Count() != 2) { return(false); } V_7 = V_6.get_Parameters(); if (isGroupJoin) { stackVariable106 = this.CreateNewIdentifier(V_7[1].get_Name(), V_7[1].get_ParameterType()); } else { stackVariable106 = V_4; } V_8 = stackVariable106; stackVariable110 = new VariableReference[2]; stackVariable110[0] = this.currentIdentifier; stackVariable110[1] = V_8; V_9 = this.ProcessReturnExpression(V_6, stackVariable110); if (V_9 == null) { return(false); } this.clauses.Add(new JoinClause(this.GetIdentifierReference(V_4, ref V_0), V_0, V_2, V_5, methodInvoke.get_InvocationInstructions())); if (isGroupJoin) { this.clauses.Add(new IntoClause(new VariableReferenceExpression(V_8, null), null)); } this.clauses.Add(new SelectClause(V_9, null)); this.currentIdentifier = null; return(true); }
public override ICodeNode VisitMethodInvocationExpression(MethodInvocationExpression node) { dummyVar0 = this.VisitMethodInvocationExpression(node); this.FixArguments(node.get_MethodExpression().get_Method(), node.get_Arguments()); return(node); }
public virtual void VisitMethodInvocationExpression(MethodInvocationExpression node) { this.Visit(node.get_MethodExpression()); this.Visit(node.get_Arguments()); return; }
public override void VisitMethodInvocationExpression(MethodInvocationExpression node) { this.VisitMethodInvocationExpression(node); this.CheckArguments(node.get_MethodExpression().get_Method().get_Parameters(), node.get_Arguments()); return; }