本文整理汇总了C#中IVwSelection.GetHardAndSoftCharProps方法的典型用法代码示例。如果您正苦于以下问题:C# IVwSelection.GetHardAndSoftCharProps方法的具体用法?C# IVwSelection.GetHardAndSoftCharProps怎么用?C# IVwSelection.GetHardAndSoftCharProps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVwSelection
的用法示例。
在下文中一共展示了IVwSelection.GetHardAndSoftCharProps方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetHardAndSoftCharProps
/// ------------------------------------------------------------------------------------
/// <summary>
/// This is like GetSelectionProps, except that the vvpsSoft items include all
/// formatting MINUS the hard formatting in the text properties (ie, those derived by
/// the view constructor and styles).
/// </summary>
/// <param name="vwSel">The view Selection</param>
/// <param name="vttp">Returned array of ITsTextProps in the selection</param>
/// <param name="vvpsSoft">Returned array of IVwPropertyStores in the selection</param>
/// <param name="cttp">Returned count of properties</param>
/// ------------------------------------------------------------------------------------
public static void GetHardAndSoftCharProps(IVwSelection vwSel,
out ITsTextProps[] vttp, out IVwPropertyStore[] vvpsSoft, out int cttp)
{
vttp = null;
vvpsSoft = null;
GetSelectionProps(vwSel, out vttp, out vvpsSoft, out cttp);
if (cttp == 0)
return;
using (ArrayPtr pvTtp = MarshalEx.ArrayToNative<ITsTextProps>(cttp))
{
using (ArrayPtr pvVps = MarshalEx.ArrayToNative<IVwPropertyStore>(cttp))
{
vwSel.GetHardAndSoftCharProps(cttp, pvTtp, pvVps, out cttp);
vttp = MarshalEx.NativeToArray<ITsTextProps>(pvTtp, cttp);
vvpsSoft = MarshalEx.NativeToArray<IVwPropertyStore>(pvVps, cttp);
}
}
}