当前位置: 首页>>代码示例>>C#>>正文


C# IHTMLItem类代码示例

本文整理汇总了C#中IHTMLItem的典型用法代码示例。如果您正苦于以下问题:C# IHTMLItem类的具体用法?C# IHTMLItem怎么用?C# IHTMLItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IHTMLItem类属于命名空间,在下文中一共展示了IHTMLItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsValidSubType

 protected override bool IsValidSubType(IHTMLItem item)
 {
     if (!base.IsValidSubType(item))
     {
         return false;
     }
     if (item is Image ||
         item is SmallText ||
         item is Sub ||
         item is Sup)
     {
         return false;
     }
     if (item.SubElements().FindAll(x => x is Image).Count > 0)
     {
         return false;
     }
     if (item.SubElements().FindAll(x => x is SmallText).Count > 0)
     {
         return false;
     }
     if (item.SubElements().FindAll(x => x is Sub).Count > 0)
     {
         return false;
     }
     if (item.SubElements().FindAll(x => x is Sup).Count > 0)
     {
         return false;
     }
     return true;
 }
开发者ID:npuBug,项目名称:fb2epub,代码行数:31,代码来源:PreFormated.cs

示例2: IsValidSubType

 protected override bool IsValidSubType(IHTMLItem item)
 {
     if (item is IBlockElement)
     {
         return item.IsValid();
     }
     return false;
 }
开发者ID:rajeshwarn,项目名称:fb2converters,代码行数:8,代码来源:NoScript.cs

示例3: IsValidSubType

 protected override bool IsValidSubType(IHTMLItem item)
 {
     if (item is Frame)
     {
         return true;
     }
     return false;
 }
开发者ID:rajeshwarn,项目名称:fb2converters,代码行数:8,代码来源:Frameset.cs

示例4: IsValidSubType

 protected override bool IsValidSubType(IHTMLItem item)
 {
     if (item is SimpleHTML5Text)
     {
         return item.IsValid();
     }
     return false;
 }
开发者ID:rajeshwarn,项目名称:fb2converters,代码行数:8,代码来源:RpElement.cs

示例5: IsValidSubType

 protected override bool IsValidSubType(IHTMLItem item)
 {
     if (item is Option)
     {
         return item.IsValid();
     }
     return false;
 }
开发者ID:npuBug,项目名称:fb2epub,代码行数:8,代码来源:OptionGroup.cs

示例6: IsValidSubType

 protected override bool IsValidSubType(IHTMLItem item)
 {
     // TODO: full check for ruby sequence
     if (item is IRubyItem)
     {
         return item.IsValid();
     }
     return false;
 }
开发者ID:npuBug,项目名称:fb2epub,代码行数:9,代码来源:RubyElement.cs

示例7: IsValidSubType

 protected override bool IsValidSubType(IHTMLItem item)
 {
     if (item is IInlineItem ||
         item is IBlockElement ||
         item is SimpleHTML5Text)
     {
         return item.IsValid();
     }
     return false;
 }
开发者ID:npuBug,项目名称:fb2epub,代码行数:10,代码来源:Canvas.cs

示例8: LinkReMapperV2

 public LinkReMapperV2(KeyValuePair<string, List<Anchor>> link, Dictionary<string, IHTMLItem> ids, BookStructureManager structureManager)
 {
     _link = link;
     _structureManager = structureManager;
     _idString = ReferencesUtils.GetIdFromLink(link.Key); // Get ID of a link target;
     _linkTargetItem = ids[_idString]; // get object targeted by link
     _linkTargetDocument = GetIDParentDocument(structureManager, _linkTargetItem); // get parent document (file) containing targeted object
     if (_linkTargetDocument != null)
     {
         _linkParentContainer = DetectItemParentContainer(_linkTargetItem); // get parent container of link target item
     }
 }
开发者ID:rajeshwarn,项目名称:fb2converters,代码行数:12,代码来源:LinkReMapperV2.cs

示例9: IsValidSubType

 protected override bool IsValidSubType(IHTMLItem item)
 {
     if (item is DefinitionDescription)
     {
         return item.IsValid();
     }
     if (item is DefinitionTerms)
     {
         return item.IsValid();
     }
     return false;
 }
开发者ID:npuBug,项目名称:fb2epub,代码行数:12,代码来源:DefinitionList.cs

示例10: IsValidSubType

 protected override bool IsValidSubType(IHTMLItem item)
 {
     if (item is Title   ||
         item is Base    ||
         item is Link    ||
         item is Meta    ||
         item is Script  ||
         item is Style   ||
         item is NoScript
         )
     {
         return item.IsValid();
     }
     return false;
 }
开发者ID:npuBug,项目名称:fb2epub,代码行数:15,代码来源:Head.cs

示例11: IsValidSubType

 protected override bool IsValidSubType(IHTMLItem item)
 {
     if (item is IInlineItem)
     {
         // TODO: check for label presence at depth
         if (item is Label)
         {
             return false;
         }
         return item.IsValid();
     }
     if (item is SimpleHTML5Text)
     {
         return item.IsValid();
     }
     return false;
 }
开发者ID:npuBug,项目名称:fb2epub,代码行数:17,代码来源:Label.cs

示例12: PartOfDocument

 /// <summary>
 /// Checks if XHTML element is part of current document
 /// </summary>
 /// <param name="value">elemenrt to check</param>
 /// <returns>true idf part of this document, false otherwise</returns>
 public override bool PartOfDocument(IHTMLItem value)
 {
     if (BookAnnotation == null)
     {
         return false;
     }
     IHTMLItem parent = value;
     while (parent.Parent != null)
     {
         parent = parent.Parent;
     }
     if (parent == BookAnnotation)
     {
         return true;
     }
     return false;
 }
开发者ID:npuBug,项目名称:epublibrary,代码行数:22,代码来源:AnnotationPageFileV3.cs

示例13: AddIdUsed

 /// <summary>
 /// Add used ID to the list
 /// </summary>
 /// <param name="id">Id to list as used</param>
 /// <param name="item">item that ID belong to</param>
 /// <returns>returns and registers the id if available, empty string if ID already exists</returns>
 public string AddIdUsed(string id,IHTMLItem item)
 {
     if (string.IsNullOrEmpty(id))
     {
         return id;
     }
     string newid = EnsureGoodId(id);
     if (_ids.ContainsKey(newid))
     {
         // we get here if in file same ID used twice
         // The assumption here that since the text located in FB2 main body we should not have same ID used more than once
         // otherwise we would not know how (and where to) go back
         Logger.Log.InfoFormat("item with ID {0} already defined, ignoring to avoid inconsistences", newid);
         return string.Empty;
     }
     _ids.Add(newid, item);
     return newid;
 }
开发者ID:rajeshwarn,项目名称:fb2converters,代码行数:24,代码来源:HRefManagerV2.cs

示例14: DetectItemParentContainer

        /// <summary>
        /// Detect parent container of the element
        /// </summary>
        /// <param name="referencedItem"></param>
        /// <returns></returns>
        private IHTMLItem DetectItemParentContainer(IHTMLItem referencedItem)
        {
            if (referencedItem is IBlockElement) // if item itself is container - return it
            {
                return referencedItem;
            }
            if (referencedItem.Parent != null)
            {
                if (referencedItem.Parent is IBlockElement) // if item is located inside container
                {
                    return referencedItem.Parent;
                }
                if (referencedItem.Parent is TextBasedElement) // if parent is text, i's ok for container
                {
                    return referencedItem.Parent;
                }
                return DetectItemParentContainer(referencedItem.Parent); // go up the inclusion chain
            }

            return null;
        }
开发者ID:rajeshwarn,项目名称:fb2converters,代码行数:26,代码来源:LinkReMapperV2.cs

示例15: IsValidSubType

        protected override bool IsValidSubType(IHTMLItem item)
        {
            if (Subitems.Count >= 2) // no more than two sub elements
            {
                return false;
            }
            if (Subitems.Count == 0) // head have to be first
            {
                if (!(item is Head)  )
                {
                    return false;
                }
            }
            if (Subitems.Count == 1) // body have to be second
            {
                if (!(item is Body)  )
                {
                    return false;
                }
            }

            return item.IsValid();
        }
开发者ID:npuBug,项目名称:fb2epub,代码行数:23,代码来源:HTML.cs


注:本文中的IHTMLItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。