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 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 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 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);
 }
 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));
 }
 private VariableReference GetArgumentArrayVariable(MethodInvocationExpression binderMethodInvocation)
 {
     V_0 = binderMethodInvocation.get_Arguments().get_Count() - 1;
     V_1 = binderMethodInvocation.get_Arguments().get_Item(V_0);
     V_2 = null;
     if (V_1.get_CodeNodeType() != 26)
     {
         if (V_1.get_CodeNodeType() == 31)
         {
             V_3 = V_1 as ExplicitCastExpression;
             if (String.op_Equality(V_3.get_ExpressionType().GetFriendlyFullName(null), "System.Collections.Generic.IEnumerable<Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo>") && V_3.get_Expression().get_CodeNodeType() == 26)
             {
                 V_2 = V_3.get_Expression() as VariableReferenceExpression;
             }
         }
     }
     else
     {
         V_2 = V_1 as VariableReferenceExpression;
     }
     if (V_2 == null)
     {
         throw new Exception("Invalid argument: argumentInfo.");
     }
     return(V_2.get_Variable());
 }
 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;
 }
Exemplo n.º 8
0
 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;
 }
 private void GetOperatorArgument(MethodInvocationExpression binderInvocation, CallSiteInfo callSiteInfo)
 {
     V_0 = 1;
     if (binderInvocation.get_Arguments().get_Item(V_0).get_CodeNodeType() != 22)
     {
         throw new Exception("Invalid argument: operator.");
     }
     callSiteInfo.set_Operator(Convert.ToInt32((binderInvocation.get_Arguments().get_Item(V_0) as LiteralExpression).get_Value()));
     return;
 }
 private void GetMemberNameArgument(MethodInvocationExpression binderInvocation, CallSiteInfo callSiteInfo)
 {
     V_0 = 1;
     if (binderInvocation.get_Arguments().get_Item(V_0).get_CodeNodeType() == 22)
     {
         callSiteInfo.set_MemberName((binderInvocation.get_Arguments().get_Item(V_0) as LiteralExpression).get_Value() as String);
         if (callSiteInfo.get_MemberName() != null)
         {
             return;
         }
     }
     throw new Exception("Invalid argument: member name.");
 }
 private MethodInvocationExpression CreateMethodInvocation(MethodDefinition method, List <Expression> arguments)
 {
     if (method.get_IsStatic())
     {
         stackVariable2 = null;
     }
     else
     {
         stackVariable2 = new ThisReferenceExpression(method.get_DeclaringType(), null);
     }
     V_0 = new MethodInvocationExpression(new MethodReferenceExpression(stackVariable2, method, null), null);
     V_1 = arguments.GetEnumerator();
     try
     {
         while (V_1.MoveNext())
         {
             V_2 = V_1.get_Current();
             V_0.get_Arguments().Add(V_2);
         }
     }
     finally
     {
         ((IDisposable)V_1).Dispose();
     }
     return(V_0);
 }
Exemplo n.º 12
0
 private void GetPair(MethodInvocationExpression addInvocation, out int value, out string str)
 {
     value = -1;
     str   = String.Empty;
     if (addInvocation.get_Arguments().get_Count() != 2)
     {
         return;
     }
     if (addInvocation.get_Arguments().get_Item(0) as LiteralExpression == null || addInvocation.get_Arguments().get_Item(1) as LiteralExpression == null)
     {
         return;
     }
     value = (Int32)(addInvocation.get_Arguments().get_Item(1) as LiteralExpression).get_Value();
     str   = (String)(addInvocation.get_Arguments().get_Item(0) as LiteralExpression).get_Value();
     return;
 }
Exemplo n.º 13
0
 public override void VisitMethodInvocationExpression(MethodInvocationExpression node)
 {
     this.VisitMethodInvocationExpression(node);
     V_0 = node.get_MethodExpression().get_Method();
     this.TraverseMethodParameters(V_0, node.get_Arguments());
     return;
 }
 private VariableReference GetTypeArrayVariable(MethodInvocationExpression binderMethodInvocation)
 {
     V_1 = binderMethodInvocation.get_Arguments().get_Item(2);
     if (V_1.get_CodeNodeType() == 22 && (V_1 as LiteralExpression).get_Value() == null)
     {
         return(null);
     }
     V_2 = null;
     if (V_1.get_CodeNodeType() != 26)
     {
         if (V_1.get_CodeNodeType() == 31)
         {
             V_3 = V_1 as ExplicitCastExpression;
             if (String.op_Equality(V_3.get_ExpressionType().GetFriendlyFullName(null), "System.Collections.Generic.IEnumerable<System.Type>") && V_3.get_Expression().get_CodeNodeType() == 26)
             {
                 V_2 = V_3.get_Expression() as VariableReferenceExpression;
             }
         }
     }
     else
     {
         V_2 = V_1 as VariableReferenceExpression;
     }
     if (V_2 == null)
     {
         throw new Exception("Invalid argument: typeArguments.");
     }
     return(V_2.get_Variable());
 }
 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);
 }
Exemplo n.º 16
0
 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));
 }
 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;
 }
		private Expression GetFieldHandleExpression(FieldReference fieldReference, IEnumerable<Instruction> instructions)
		{
			V_0 = this.GetSystemTypeTypeDefinition();
			stackVariable6 = new String[1];
			stackVariable6[0] = "System.String";
			V_1 = this.GetSystemTypeMethodReference(V_0, "GetField", stackVariable6);
			stackVariable18 = new MethodInvocationExpression(new MethodReferenceExpression(new TypeOfExpression(fieldReference.get_DeclaringType(), null), V_1, null), null);
			stackVariable18.get_Arguments().Add(new LiteralExpression(fieldReference.get_Name(), this.typeSystem, null));
			V_2 = this.GetHandlePropertyGetterReference(Type.GetTypeFromHandle(// 
 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);
 }
 private void GetConvertTypeArgument(MethodInvocationExpression binderInvocation, CallSiteInfo callSiteInfo)
 {
     V_0 = 1;
     if (binderInvocation.get_Arguments().get_Item(V_0).get_CodeNodeType() != 19 || !(binderInvocation.get_Arguments().get_Item(V_0) as MethodInvocationExpression).IsTypeOfExpression(out V_1))
     {
         throw new Exception("Invalid argument: convert type.");
     }
     callSiteInfo.set_ConvertType(V_1);
     return;
 }
 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;
 }
Exemplo n.º 22
0
 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 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);
 }
Exemplo n.º 24
0
 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 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;
 }
 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);
 }
Exemplo n.º 27
0
 public virtual void VisitMethodInvocationExpression(MethodInvocationExpression node)
 {
     this.Visit(node.get_MethodExpression());
     this.Visit(node.get_Arguments());
     return;
 }
 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 void VisitMethodInvocationExpression(MethodInvocationExpression node)
 {
     this.VisitMethodInvocationExpression(node);
     this.CheckArguments(node.get_MethodExpression().get_Method().get_Parameters(), node.get_Arguments());
     return;
 }
 public override ICodeNode VisitMethodInvocationExpression(MethodInvocationExpression node)
 {
     dummyVar0 = this.VisitMethodInvocationExpression(node);
     this.FixArguments(node.get_MethodExpression().get_Method(), node.get_Arguments());
     return(node);
 }