• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IHTMLItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Add

 /// <summary>
 /// Adds sub-item to the item , only if 
 /// allowed by the rules and element can accept content
 /// </summary>
 /// <param name="item">sub-item to add</param>
 public virtual void Add(IHTMLItem item)
 {
     if ((item != null) && IsValidSubType(item))
     {
         Subitems.Add(item);
         item.Parent = this;
     }
     else
     {
         throw new HTML5ViolationException();
     }
 }
开发者ID:rajeshwarn,项目名称:fb2converters,代码行数:17,代码来源:HTMLItem.cs


示例17: Add

 /// <summary>
 /// Adds sub item to the item , only if 
 /// allowed by the rules and element can accept content
 /// simple text can't have sub-items so it will always return false
 /// </summary>
 /// <param name="item">sub item to add</param>
 public override void Add(IHTMLItem item)
 {
     throw new Exception("This element does not contain or obtain sub items");
 }
开发者ID:npuBug,项目名称:fb2epub,代码行数:10,代码来源:SimpleHTML5Text.cs


示例18: GetIDParentDocument

 private BaseXHTMLFileV2 GetIDParentDocument(EPubFileV2 file, IHTMLItem value)
 {
     if ((file.AnnotationPage != null) && file.AnnotationPage.PartOfDocument(value))
     {
         return file.AnnotationPage;
     }
     return file.GetIDOfParentDocument(value) as BaseXHTMLFileV2;
 }
开发者ID:npuBug,项目名称:fb2epub,代码行数:8,代码来源:HRefManagerV2.cs


示例19: SplitBlockHTMLItem

 private ulong SplitBlockHTMLItem(IHTMLItem item, Div content, IList<IHTMLItem> resList, ulong documentSize)
 {
     ulong docSize = documentSize;
     ulong itemSize = item.EstimateSize();
     if (_checker.ExceedSizeLimit(documentSize + itemSize))
     {
         var oldContent = content;
         resList.Add(content);
         content = new Div(HTMLElementType.HTML5);
         content.GlobalAttributes.Class.Value = oldContent.GlobalAttributes.Class.Value;
         content.GlobalAttributes.Language.Value = oldContent.GlobalAttributes.Language.Value;
         docSize = 0;
     }
     if (!_checker.ExceedSizeLimit(itemSize)) // if we can "fit" element into a max size XHTML document
     {
         docSize += itemSize;
         content.Add(item);
     }
     else
     {
         var div = item as Div;
         if (div != null) // if the item that bigger than max size is Div block
         {
             foreach (var splitedItem in SplitDiv(div, documentSize))
             {
                 documentSize = SplitSimpleHTMLItem(splitedItem, content, resList, documentSize);
             }
         }
     }
     return docSize;
 }
开发者ID:rajeshwarn,项目名称:fb2converters,代码行数:31,代码来源:SectionConverterV3.cs


示例20: GetIDParentDocument

 private BaseXHTMLFileV2 GetIDParentDocument(BookStructureManager structureManager, IHTMLItem value)
 {
     return structureManager.GetItemParentDocument(value) as BaseXHTMLFileV2;
 }
开发者ID:rajeshwarn,项目名称:fb2converters,代码行数:4,代码来源:LinkReMapperV2.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IHand类代码示例发布时间:2022-05-24
下一篇:
C# IHTMLEventObj类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap