예제 #1
0
 override public bool Replace(Node existing, Node newNode)
 {
     if (base.Replace(existing, newNode))
     {
         return(true);
     }
     if (_modifier == existing)
     {
         this.Modifier = (StatementModifier)newNode;
         return(true);
     }
     if (_arguments != null)
     {
         Expression item = existing as Expression;
         if (null != item)
         {
             Expression newItem = (Expression)newNode;
             if (_arguments.Replace(item, newItem))
             {
                 return(true);
             }
         }
     }
     if (_body == existing)
     {
         this.Body = (Block)newNode;
         return(true);
     }
     return(false);
 }
예제 #2
0
 override public bool Replace(Node existing, Node newNode)
 {
     if (base.Replace(existing, newNode))
     {
         return(true);
     }
     if (_arguments != null)
     {
         Expression item = existing as Expression;
         if (null != item)
         {
             Expression newItem = (Expression)newNode;
             if (_arguments.Replace(item, newItem))
             {
                 return(true);
             }
         }
     }
     if (_namedArguments != null)
     {
         ExpressionPair item = existing as ExpressionPair;
         if (null != item)
         {
             ExpressionPair newItem = (ExpressionPair)newNode;
             if (_namedArguments.Replace(item, newItem))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
예제 #3
0
 override public bool Replace(Node existing, Node newNode)
 {
     if (base.Replace(existing, newNode))
     {
         return(true);
     }
     if (_clauses != null)
     {
         Expression item = existing as Expression;
         if (null != item)
         {
             Expression newItem = (Expression)newNode;
             if (_clauses.Replace(item, newItem))
             {
                 return(true);
             }
         }
     }
     if (_ending == existing)
     {
         this.Ending = (QueryEndingExpression)newNode;
         return(true);
     }
     if (_cont == existing)
     {
         this.Cont = (QueryContinuationExpression)newNode;
         return(true);
     }
     return(false);
 }
예제 #4
0
 override public bool Replace(Node existing, Node newNode)
 {
     if (base.Replace(existing, newNode))
     {
         return(true);
     }
     if (_items != null)
     {
         Expression item = existing as Expression;
         if (null != item)
         {
             Expression newItem = (Expression)newNode;
             if (_items.Replace(item, newItem))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
예제 #5
0
        void BindNullableParameters(ExpressionCollection args, ICallableType target)
        {
            if (null == target)
                return;

            IParameter[] parameters = target.GetSignature().Parameters;
            for (int i = 0; i < parameters.Length; ++i) {
                if (!TypeSystemServices.IsNullable(parameters[i].Type))
                    continue;
                if (TypeSystemServices.IsNullable(GetExpressionType(args[i])))
                    continue; //already nullable
                args.Replace(args[i], CreateNullableInstantiation(args[i], parameters[i].Type));
                Visit(args[i]);
            }
        }