Beispiel #1
0
        public void Visit(HtmlContent h)
        {
            var mi = (from m in GetType().GetMethods()
                      where
                      m.ReturnType.Equals(typeof(void)) &&
                      m.GetParameters().Length == 1 &&
                      m.GetParameters()[0].ParameterType.Equals(h.GetType())
                      select m).SingleOrDefault();

            if (mi != null)
            {
                mi.Invoke(this, new object[] { h });
            }
            else
            {
                throw new NotImplementedException();
            }
        }