public override Expression CloneExpressionOnly()
        {
            MethodReferenceExpression   methodExpressionClone = (MethodReferenceExpression)this.MethodExpression.CloneExpressionOnly();
            PropertyReferenceExpression result = new PropertyReferenceExpression(methodExpressionClone, this.Property, this.VirtualCall, null)
            {
                Arguments = this.Arguments.CloneExpressionsOnly()
            };

            return(result);
        }
		public ICodeNode VisitMethodInvocationExpression(MethodInvocationExpression node)
		{
			MethodReferenceExpression methodRef = node.MethodExpression;

			if (methodRef == null)
			{
				return null;
			}

			MethodDefinition method = methodRef.Method as MethodDefinition;

			//// must be resolved.
			if (method == null)
			{
				MethodReference methodReference = methodRef.Method;
				if (methodReference != null
					&& !string.IsNullOrEmpty(methodReference.Name)
					&& (methodReference.Name.StartsWith("set_") || methodReference.Name.StartsWith("get_") || methodReference.Name.StartsWith("put_") /*Setter prefix in winrt*/))
				{
					method = methodReference.Resolve();
				}
			}

			if (method != null)
			{
				if (method.IsGetter || method.IsSetter)
				{
					PropertyReferenceExpression propExpr = new PropertyReferenceExpression(node, null);
					if (propExpr.Property == null)
					{
						// sanity check - if the method is resolved and is determined to be getter/setter, then a
						// property record should be available.
						return node;
					}
					Expression result = propExpr;
					if (method.IsSetter)
					{
						int last = node.Arguments.Count - 1;
						result = new BinaryExpression(BinaryOperator.Assign, propExpr, node.Arguments[last], typeSystem, null);
					}
					return result;
				}
			}
			return null;
		}
        private Expression GetMethodHandleExpression(MethodReference methodReference, IEnumerable<Instruction> instructions)
        {
            TypeDefinition corlibTypeTypeDefinition = GetSystemTypeTypeDefinition();

            string[] parametersNames = methodReference.HasParameters ? new string[] { "System.String", "System.Type[]" } : new string[] { "System.String" };
            MethodReference getMethodReference = GetSystemTypeMethodReference(corlibTypeTypeDefinition, "GetMethod", parametersNames);

            MethodReference getMethodHandleReference = GetHandlePropertyGetterReference(typeof(System.Reflection.MethodBase), "get_MethodHandle");

            TypeOfExpression typeOfExpression = new TypeOfExpression(methodReference.DeclaringType, null);
            MethodReferenceExpression getMethodMethodReferenceExpression = new MethodReferenceExpression(typeOfExpression, getMethodReference, null);
            MethodInvocationExpression getMethodMethodInvocationExpression = new MethodInvocationExpression(getMethodMethodReferenceExpression, null);
            LiteralExpression argument = new LiteralExpression(methodReference.Name, this.typeSystem, null);
            getMethodMethodInvocationExpression.Arguments.Add(argument);

            if (methodReference.HasParameters)
            {
                BlockExpression blockExpression = new BlockExpression(null);
                foreach (ParameterDefinition parameter in methodReference.Parameters)
                {
                    blockExpression.Expressions.Add(new TypeOfExpression(parameter.ParameterType, null));
                }

				InitializerExpression initializer = new InitializerExpression(blockExpression, InitializerType.ArrayInitializer);
				ArrayCreationExpression getMethodTypeParametersArray = new ArrayCreationExpression(corlibTypeTypeDefinition, initializer, null);
                getMethodTypeParametersArray.Dimensions.Add(new LiteralExpression(blockExpression.Expressions.Count, this.typeSystem, null));

                getMethodMethodInvocationExpression.Arguments.Add(getMethodTypeParametersArray);
            }

            MethodReferenceExpression getMethodHandleMethodReferenceExpression = new MethodReferenceExpression(getMethodMethodInvocationExpression, getMethodHandleReference, null);
            MethodInvocationExpression getMethodHandleMethodInvocationExpression = new MethodInvocationExpression(getMethodHandleMethodReferenceExpression, instructions);
            PropertyReferenceExpression methodHandlePropertyReferenceExpression = new PropertyReferenceExpression(getMethodHandleMethodInvocationExpression, null);

            return methodHandlePropertyReferenceExpression;
        }
		public override void VisitPropertyReferenceExpression(PropertyReferenceExpression node)
		{
			if (node.Target != null)
			{
				bool isComplexTarget = IsComplexTarget(node.Target);

				if (isComplexTarget)
				{
					WriteToken("(");
				}

				Visit(node.Target);

				if (isComplexTarget)
				{
					WriteToken(")");
				}
			}
			else
			{
				WriteReferenceAndNamespaceIfInCollision(node.DeclaringType);
			}

			if (!node.IsIndexer)
			{
				WriteToken(".");
				WritePropertyName(node.Property);
			}
			else
			{
				WriteToken(IndexLeftBracket);
				for (int i = 0; i < node.Arguments.Count; i++)
				{
					Expression parameter = node.Arguments[i];

					if (i > 0)
					{
						WriteToken(",");
						WriteSpace();
					}

					Write(parameter);
				}
				WriteToken(IndexRightBracket);
			}
		}
 public override Expression CloneExpressionOnly()
 {
     MethodReferenceExpression methodExpressionClone = (MethodReferenceExpression)this.MethodExpression.CloneExpressionOnly();
     PropertyReferenceExpression result = new PropertyReferenceExpression(methodExpressionClone, this.Property, this.VirtualCall, null)
         { Arguments = this.Arguments.CloneExpressionsOnly() };
     return result;
 }
        public override ICodeNode VisitPropertyReferenceExpression(PropertyReferenceExpression node)
        {
            PropertyReferenceExpression result =(PropertyReferenceExpression) base.VisitPropertyReferenceExpression(node);
            if (node.Arguments.Count > 0)
            {
				VisitInvocationArguments(result.Arguments, result.MethodExpression.Method);
            }
            return result;
        }
 private ICodeNode ConvertProperty(MethodInvocationExpression invocation)
 {
     MethodInvocationExpression methodInvocation = ConvertCall(invocation) as MethodInvocationExpression;
     if(methodInvocation != null)
     {
         PropertyReferenceExpression result = new PropertyReferenceExpression(methodInvocation, null);
         return result.Property != null ? result : null;
     }
     return null;
 }
		public override void VisitPropertyReferenceExpression(PropertyReferenceExpression node)
		{
			TypesDependingOn.UnionWith(Utilities.GetTypeReferenceTypesDepedningOn(node.Property.DeclaringType));
			base.VisitPropertyReferenceExpression(node);
		}
        protected void WriteIndexerArguments(PropertyReferenceExpression node)
        {
            WriteToken(IndexLeftBracket);
            for (int i = 0; i < node.Arguments.Count; i++)
            {
                Expression parameter = node.Arguments[i];

                if (i > 0)
                {
                    WriteToken(",");
                    WriteSpace();
                }

                Write(parameter);
            }
            WriteToken(IndexRightBracket);
        }
 public override Expression CloneExpressionOnly()
 {
     stackVariable9 = new PropertyReferenceExpression((MethodReferenceExpression)this.get_MethodExpression().CloneExpressionOnly(), this.get_Property(), this.get_VirtualCall(), null);
     stackVariable9.set_Arguments(this.get_Arguments().CloneExpressionsOnly());
     return(stackVariable9);
 }
 public override ICodeNode VisitPropertyReferenceExpression(PropertyReferenceExpression node)
 {
     if (node.Property.Name == "Current")
     {
         VariableReferenceExpression nodeTarget = node.Target as VariableReferenceExpression;
         if (nodeTarget != null && nodeTarget.Variable == enumerator)
         {
             return new VariableReferenceExpression(foreachVariable, null);
         }
     }
     return base.VisitPropertyReferenceExpression(node);
 }
		public override void VisitPropertyReferenceExpression(PropertyReferenceExpression node)
		{
			base.VisitPropertyReferenceExpression(node);
			if (node.IsIndexer)
			{
				CheckArguments(node.Property.Parameters, node.Arguments);
			}
		}
 public virtual void VisitPropertyReferenceExpression(PropertyReferenceExpression node)
 {
     Visit(node.Target);
     Visit(node.Arguments);
 }
 public override ICodeNode VisitPropertyReferenceExpression(PropertyReferenceExpression node)
 {
     node.Target = (Expression)VisitTargetExpression(node.Target);
     node.Arguments = (ExpressionCollection)Visit(node.Arguments);
     return node;
 }
 public override ICodeNode VisitPropertyReferenceExpression(PropertyReferenceExpression node)
 {
     MethodReferenceExpression methodRefExpression = node.MethodExpression;
     if (methodRefExpression.Target != null)
     {
         if (methodRefExpression.Target.CodeNodeType == CodeNodeType.VariableReferenceExpression &&
             asyncData.AwaiterVariables.Contains((methodRefExpression.Target as VariableReferenceExpression).Variable))
         {
             VariableReference awaiterVariable = (methodRefExpression.Target as VariableReferenceExpression).Variable;
             if (currentAwaiterVariable == awaiterVariable)
             {
                 if (methodRefExpression.Method.Name == "get_IsCompleted")
                 {
                     if (matcherState == MatcherState.FindIsCompletedInvoke)
                     {
                         matcherState = MatcherState.FindInitObj | MatcherState.FindGetResultInvoke;
                         return null;
                     }
                 }
             }
             matcherState = MatcherState.Stopped;
             return node;
         }
     }
     return base.VisitPropertyReferenceExpression(node);
 }
                public override ICodeNode VisitPropertyReferenceExpression(PropertyReferenceExpression node)
                {
                    base.VisitPropertyReferenceExpression(node);

                    Dictionary<MethodDefinition, VariableReference> methodDefToIdentifierReference;
                    if (node.Target != null && node.Target.CodeNodeType == CodeNodeType.VariableReferenceExpression &&
                        this.TransparentIdentifierToPropertyValueMap.TryGetValue((node.Target as VariableReferenceExpression).Variable, out methodDefToIdentifierReference))
                    {
                        return new VariableReferenceExpression(methodDefToIdentifierReference[node.MethodExpression.MethodDefinition], node.UnderlyingSameMethodInstructions);
                    }
                    return node;
                }
        public override void VisitPropertyReferenceExpression(PropertyReferenceExpression node)
        {
            if (node.Target != null)
            {
                bool isComplexTarget = IsComplexTarget(node.Target);

                if (isComplexTarget)
                {
                    WriteToken("(");
                }

                Visit(node.Target);

                if (isComplexTarget)
                {
                    WriteToken(")");
                }
            }
            else
            {
                WriteReferenceAndNamespaceIfInCollision(node.DeclaringType);
            }

            if (!node.IsIndexer)
            {
                WriteToken(".");
                WritePropertyName(node.Property);
            }
            else
            {
                WriteIndexerArguments(node);
            }
        }
 public override void VisitPropertyReferenceExpression(PropertyReferenceExpression node)
 {
     if (!foundWhile && IsGetCurrent(node))
     {
         //TryStatement ts = theTry;
         ClearState();
         //theTry = ts;
         //insideTry = ts != null;
     }
     else
     {
         if (IsGetCurrent(node))
         {
             foreachVariableType = node.ExpressionType;
         }
     }
 }
 public override Expression Clone()
 {
     stackVariable10 = new PropertyReferenceExpression((MethodReferenceExpression)this.get_MethodExpression().Clone(), this.get_Property(), this.get_VirtualCall(), this.instructions);
     stackVariable10.set_Arguments(this.get_Arguments().Clone());
     return(stackVariable10);
 }
 public override void VisitPropertyReferenceExpression(PropertyReferenceExpression node)
 {
     if (IsGetCurrent(node))
     {
         ResultingType = node.ExpressionType;
     }
     base.VisitPropertyReferenceExpression(node);
 }
 public override void VisitPropertyReferenceExpression(PropertyReferenceExpression node)
 {
     if (state == SearchState.Propagation)
     {
         canBePropagated = false;
         return;
     }
     base.VisitPropertyReferenceExpression(node);
 }
            public override void VisitPropertyReferenceExpression(PropertyReferenceExpression node)
            {
                if (node.Property.Name != "Current")
                {
                    VariableReferenceExpression nodeTarget = node.Target as VariableReferenceExpression;
                    if (nodeTarget != null && nodeTarget.Variable == enumerator)
                    {
                        IsEnumeratorUsed = true;
                    }
                }

                base.VisitPropertyReferenceExpression(node);
            }
		public override void VisitPropertyReferenceExpression(PropertyReferenceExpression node)
        {
            TrySetPendingName(node.Property.Name, true);
            base.VisitPropertyReferenceExpression(node);
        }