本文整理汇总了C#中Bloom.Book.HtmlDom.GetTemplateStyleSheets方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlDom.GetTemplateStyleSheets方法的具体用法?C# HtmlDom.GetTemplateStyleSheets怎么用?C# HtmlDom.GetTemplateStyleSheets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bloom.Book.HtmlDom
的用法示例。
在下文中一共展示了HtmlDom.GetTemplateStyleSheets方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddStylesheetFromAnotherBook
public static void AddStylesheetFromAnotherBook(HtmlDom sourceBookDom, HtmlDom targetBookDom)
{
var addedModifiedStyleSheets = new List<string>();
//This was refactored from book, where there was these notes:
// NB: at this point this code can't handle the "userModifiedStyles" from children, it'll ignore them (they would conflict with each other)
// NB: at this point custom styles (e.g. larger/smaller font rules) from children will be lost.
//At this point, this addedModifiedStyleSheets is just used as a place to track which stylesheets we already have
foreach(string sheetName in sourceBookDom.GetTemplateStyleSheets())
{
if(!addedModifiedStyleSheets.Contains(sheetName))
//nb: if two books have stylesheets with the same name, we'll only be grabbing the 1st one.
{
addedModifiedStyleSheets.Add(sheetName);
targetBookDom.AddStyleSheetIfMissing(sheetName);
}
}
}