Esempio n. 1
0
 public void Accept(ValueGetterVisitor visitor)
 {
     try
     {
         var method = visitor.GetType().GetMethod("Visit", new Type[] { this.GetType() });
         if (method != null)
         {
             method.Invoke(visitor, new object[] { this });
         }
         else
         {
             visitor.NoMatch(this);
         }
     }
     catch (System.Reflection.TargetInvocationException ex)
     {
         throw ex.InnerException;
     }
 }
Esempio n. 2
0
 internal void Accept(ValueGetterVisitor visitor)
 {
     try
     {
         var method = visitor.GetType().GetMethod("Visit", new Type[] { this.GetType() });
         if (method != null)
         {
             method.Invoke(visitor, new object[] { this });
         }
         else
         {
             visitor.NoMatch(this);
         }
     }
     catch (System.Reflection.TargetInvocationException ex)
     {
         throw ex.InnerException;
     }
 }