本文整理汇总了C#中FwStyleSheet.PutStyle方法的典型用法代码示例。如果您正苦于以下问题:C# FwStyleSheet.PutStyle方法的具体用法?C# FwStyleSheet.PutStyle怎么用?C# FwStyleSheet.PutStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FwStyleSheet
的用法示例。
在下文中一共展示了FwStyleSheet.PutStyle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetFontSizeLineHeightAndSpaceBeforeAfter
/// ------------------------------------------------------------------------------------
/// <summary>
/// Sets the font size line height and space before after.
/// </summary>
/// <param name="stylesheet">The real stylesheet.</param>
/// <param name="styleName">Name of the style to modify.</param>
/// <param name="basedOnStyle">The name of the based-on style.</param>
/// <param name="fontSize">Size of the font.</param>
/// <param name="lineHeight">Height of the line.</param>
/// <param name="spaceBefore">The space before.</param>
/// <param name="spaceAfter">The space after.</param>
/// ------------------------------------------------------------------------------------
private static void SetFontSizeLineHeightAndSpaceBeforeAfter(FwStyleSheet stylesheet,
string styleName, string basedOnStyle, int fontSize, int lineHeight, int spaceBefore,
int spaceAfter)
{
IStStyle style = stylesheet.FindStyle(styleName);
TsPropsBldr tpb = (TsPropsBldr)style.Rules.GetBldr();
if (fontSize != -1)
{
tpb.SetIntPropValues((int)FwTextPropType.ktptFontSize,
(int)FwTextPropVar.ktpvMilliPoint, fontSize);
}
if (lineHeight != -1)
{
tpb.SetIntPropValues((int)FwTextPropType.ktptLineHeight,
(int)FwTextPropVar.ktpvMilliPoint, lineHeight);
}
if (spaceBefore != -1)
{
tpb.SetIntPropValues((int)FwTextPropType.ktptSpaceBefore,
(int)FwTextPropVar.ktpvMilliPoint, spaceBefore);
}
if (spaceAfter != -1)
{
tpb.SetIntPropValues((int)FwTextPropType.ktptSpaceAfter,
(int)FwTextPropVar.ktpvMilliPoint, spaceAfter);
}
int hvoBasedOn = 0;
if (!string.IsNullOrEmpty(basedOnStyle))
{
IStStyle basedOn = stylesheet.FindStyle(basedOnStyle);
if (basedOn != null)
hvoBasedOn = basedOn.Hvo;
}
stylesheet.PutStyle(styleName, string.Empty, style.Hvo, hvoBasedOn, 0,
(int)StyleType.kstParagraph, true, false, tpb.GetTextProps());
}