本文整理汇总了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;
}