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


C# IVwStylesheet.GetStyleRgch方法代码示例

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


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

示例1: SpellCheckProps

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Answer the spelling status of the indicated character in the string, unless it is an
		/// ORC, in which case, for each ORC we answer a different value (that is not any of the
		/// valid spelling statuses).
		/// Enhance JohnT: we don't want to consider embedded-picture ORCs to count as
		/// different; we may strip them out before we start checking the word.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		int SpellCheckProps(ITsString tss, int ich, IVwStylesheet styles)
		{
			// For our purposes here, ORC (0xfffc) is considered to have a different spelling status from everything else,
			// even from every other ORC in the string. This means we always offer to insert spaces adjacent to them.
			if (ich < tss.Length && tss.GetChars(ich, ich + 1)[0] == 0xfffc)
			{
				return -50 - ich;
			}
			ITsTextProps props = tss.get_PropertiesAt(ich);
			string style = props.GetStrPropValue((int)FwTextPropType.ktptNamedStyle);
			int var, val;
			if (styles != null && !string.IsNullOrEmpty(style))
			{
				ITsTextProps styleProps = styles.GetStyleRgch(style.Length, style);
				if (styleProps != null)
				{
					val = styleProps.GetIntPropValues((int)FwTextPropType.ktptSpellCheck, out var);
					if (var != -1)
						return val; // style overrides
				}
			}
			val = props.GetIntPropValues((int)FwTextPropType.ktptSpellCheck, out var);
			if (var == -1)
				return 0; // treat unspecified the same as default.
			else
				return val;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:36,代码来源:SpellCheckHelper.cs

示例2: 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);
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:19,代码来源:XhtmlHelper.cs


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