Пример #1
0
 override public bool Replace(Node existing, Node newNode)
 {
     if (base.Replace(existing, newNode))
     {
         return(true);
     }
     if (_target == existing)
     {
         this.Target = (Expression)newNode;
         return(true);
     }
     if (_genericArguments != null)
     {
         TypeReference item = existing as TypeReference;
         if (null != item)
         {
             TypeReference newItem = (TypeReference)newNode;
             if (_genericArguments.Replace(item, newItem))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Пример #2
0
 override public bool Replace(Node existing, Node newNode)
 {
     if (base.Replace(existing, newNode))
     {
         return(true);
     }
     if (_attributes != null)
     {
         Attribute item = existing as Attribute;
         if (null != item)
         {
             Attribute newItem = (Attribute)newNode;
             if (_attributes.Replace(item, newItem))
             {
                 return(true);
             }
         }
     }
     if (_members != null)
     {
         TypeMember item = existing as TypeMember;
         if (null != item)
         {
             TypeMember newItem = (TypeMember)newNode;
             if (_members.Replace(item, newItem))
             {
                 return(true);
             }
         }
     }
     if (_baseTypes != null)
     {
         TypeReference item = existing as TypeReference;
         if (null != item)
         {
             TypeReference newItem = (TypeReference)newNode;
             if (_baseTypes.Replace(item, newItem))
             {
                 return(true);
             }
         }
     }
     if (_genericParameters != null)
     {
         GenericParameterDeclaration item = existing as GenericParameterDeclaration;
         if (null != item)
         {
             GenericParameterDeclaration newItem = (GenericParameterDeclaration)newNode;
             if (_genericParameters.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 (_baseTypes != null)
     {
         TypeReference item = existing as TypeReference;
         if (null != item)
         {
             TypeReference newItem = (TypeReference)newNode;
             if (_baseTypes.Replace(item, newItem))
             {
                 return(true);
             }
         }
     }
     return(false);
 }