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


C# HtmlPipelineContext.GetMemory方法代码示例

本文整理汇总了C#中iTextSharp.tool.xml.pipeline.html.HtmlPipelineContext.GetMemory方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlPipelineContext.GetMemory方法的具体用法?C# HtmlPipelineContext.GetMemory怎么用?C# HtmlPipelineContext.GetMemory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iTextSharp.tool.xml.pipeline.html.HtmlPipelineContext的用法示例。


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

示例1: CalculateMarginTop

 /**
  * Calculates the margin top or spacingBefore based on the given value and the last margin bottom.
  * <br /><br />
  * In HTML the margin-bottom of a tag overlaps with the margin-top of a following tag.
  * This method simulates this behavior by subtracting the margin-top value of the given tag from the margin-bottom of the previous tag. The remaining value is returned or if the margin-bottom value is the largest, 0 is returned
  * @param value float containing the margin-top value.
  * @param configuration XmlWorkerConfig containing the last margin bottom.
  * @return an offset
  */
 public float CalculateMarginTop(float value, HtmlPipelineContext configuration)
 {
     float marginTop = value;
     IDictionary<String, Object> memory = configuration.GetMemory();
     Object mb;
     memory.TryGetValue(HtmlPipelineContext.LAST_MARGIN_BOTTOM, out mb);
     if (mb != null) {
         float marginBottom = (float)mb;
         marginTop = (marginTop>marginBottom)?marginTop-marginBottom:0;
     }
     return marginTop;
 }
开发者ID:boecko,项目名称:iTextSharp,代码行数:21,代码来源:CssUtils.cs


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