コード例 #1
0
 protected override bool IsValidSubType(IHTMLItem item)
 {
     // may appear only once and only as first element
     if (item is TableCaption)
     {
         if (Subitems.Count > 0)
         {
             return(false);
         }
         IHTMLItem seekItem = Subitems.Find(x => x is TableCaption);
         if (seekItem != null)
         {
             return(false);
         }
         return(item.IsValid());
     }
     if (item is ColElement)
     {
         return(item.IsValid());
     }
     if (item is ColGroup)
     {
         return(item.IsValid());
     }
     if (item is TableBody)
     {
         IHTMLItem seekItem = Subitems.Find(x => x is TableBody);
         if (seekItem != null)
         {
             return(false);
         }
         seekItem = Subitems.Find(x => x is TableRow);
         if (seekItem != null)
         {
             return(false);
         }
         return(item.IsValid());
     }
     if (item is TableRow)
     {
         IHTMLItem seekItem = Subitems.Find(x => x is TableBody);
         if (seekItem != null)
         {
             return(false);
         }
         seekItem = Subitems.Find(x => x is TableHead);
         if (seekItem != null)
         {
             return(false);
         }
         seekItem = Subitems.Find(x => x is TableFooter);
         if (seekItem != null)
         {
             return(false);
         }
         return(item.IsValid());
     }
     return(false);
 }