1 public abstract class A<T> : B where T : C { 2 //protected 3 public A(T importer) 4 : base(importer) { 5 } 6 //internal 7 public virtual new T Importer { get { return (T)base.Importer; } } 8 public abstract ElementHandlerTable<T> ElementHandlerTable { get; } 9 public override void ProcessElementOpen(XmlReader reader) { 10 } 11 public override void ProcessElementClose(XmlReader reader) { 12 } 13 public override bool ProcessText(XmlReader reader) { 14 return true; 15 } 16 // public 17 public override B C(XmlReader reader) { 18 string localName = reader.LocalName; 19 ElementHandler<T> handler; 20 if (ElementHandlerTable.TryGetValue(localName, out handler)) 21 return handler(Importer, reader); 22 else 23 return null; 24 } 25 }