本文整理汇总了C#中IVwStylesheet.get_NthStyle方法的典型用法代码示例。如果您正苦于以下问题:C# IVwStylesheet.get_NthStyle方法的具体用法?C# IVwStylesheet.get_NthStyle怎么用?C# IVwStylesheet.get_NthStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVwStylesheet
的用法示例。
在下文中一共展示了IVwStylesheet.get_NthStyle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadStyles
private void ReadStyles(IVwStylesheet vss)
{
string normalStyleName = vss.GetDefaultBasedOnStyleName();
m_styleTable = new StyleInfoTable(normalStyleName,
m_cache.ServiceLocator.WritingSystemManager);
int cStyles = vss.CStyles;
for (int i = 0; i < cStyles; ++i)
{
int hvo = vss.get_NthStyle(i);
var sty = m_cache.ServiceLocator.GetInstance<IStStyleRepository>().GetObject(hvo);
// CSS does not implement the kind of inheritance our styles use. To get the style
// definitions we want in the CSS, we must create these styles using the 'net effect' of
// each style and all the ones it is based on. Happily the VwStyleSheet knows exactly
// how to do this.
var props = vss.GetStyleRgch(sty.Name.Length, sty.Name);
var exportStyleInfo = new ExportStyleInfo(sty, props);
m_styleTable.Add(GetValidCssClassName(sty.Name), exportStyleInfo);
}
}
示例2: FillInStylesComboList
/// ------------------------------------------------------------------------------------
/// <summary>
/// Fill in the list of style names.
/// </summary>
/// ------------------------------------------------------------------------------------
protected override void FillInStylesComboList(UIListDisplayProperties display, IVwStylesheet stylesheet)
{
display.List.Clear();
string charImage = "CharStyle";
string paraImage = "ParaStyle";
int cStyles = stylesheet.CStyles;
for (int i = 0; i < cStyles; ++i)
{
string name = stylesheet.get_NthStyleName(i);
int hvo = stylesheet.get_NthStyle(i);
int type = stylesheet.GetType(name);
if (type == (int)StyleType.kstCharacter || IsSelectionInParagraph)
{
display.List.Add(name, name,
type == (int)StyleType.kstCharacter ? charImage : paraImage,
null);
}
}
string nameDefault = StyleUtils.DefaultParaCharsStyleName;
display.List.Add(nameDefault, nameDefault, charImage, null);
display.List.Sort();
}
示例3: ReadStyles
private void ReadStyles(IVwStylesheet vss)
{
string normalStyleName = vss.GetDefaultBasedOnStyleName();
m_styleTable = new StyleInfoTable(normalStyleName,
m_cache.LanguageWritingSystemFactoryAccessor);
int cStyles = vss.CStyles;
for (int i = 0; i < cStyles; ++i)
{
int hvo = vss.get_NthStyle(i);
IStStyle sty = StStyle.CreateFromDBObject(m_cache, hvo);
m_styleTable.Add(sty.Name, new ExportStyleInfo(sty));
}
}