Ejemplo n.º 1
0
 override public bool Replace(Node existing, Node newNode)
 {
     if (base.Replace(existing, newNode))
     {
         return(true);
     }
     if (_expression == existing)
     {
         this.Expression = (Expression)newNode;
         return(true);
     }
     if (_declarations != null)
     {
         Declaration item = existing as Declaration;
         if (null != item)
         {
             Declaration newItem = (Declaration)newNode;
             if (_declarations.Replace(item, newItem))
             {
                 return(true);
             }
         }
     }
     if (_iterator == existing)
     {
         this.Iterator = (Expression)newNode;
         return(true);
     }
     if (_filter == existing)
     {
         this.Filter = (StatementModifier)newNode;
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
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 (_declarations != null)
     {
         Declaration item = existing as Declaration;
         if (null != item)
         {
             Declaration newItem = (Declaration)newNode;
             if (_declarations.Replace(item, newItem))
             {
                 return(true);
             }
         }
     }
     if (_iterator == existing)
     {
         this.Iterator = (Expression)newNode;
         return(true);
     }
     if (_block == existing)
     {
         this.Block = (Block)newNode;
         return(true);
     }
     if (_orBlock == existing)
     {
         this.OrBlock = (Block)newNode;
         return(true);
     }
     if (_thenBlock == existing)
     {
         this.ThenBlock = (Block)newNode;
         return(true);
     }
     return(false);
 }