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; } }
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; } }