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


C# IVwStylesheet.GetNextStyle方法代码示例

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


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

示例1: InsertNew

		/// <summary>
		/// Insert chvo new objects after the one at ihvo, which functions as a pattern.
		/// Typically used when splitting a paragraph at ihvo.
		/// The new objects should generally be similar to the one at ihvo, except that
		/// the main text property that forms the paragraph body should be empty.
		/// If the object has a paragraph style property, the new objects should have
		/// the same style as the one at ihvo, except that, if a stylesheet is passed,
		/// each successive paragraph inserted should have the appropriate next style
		/// for the one named in the previous paragraph.
		/// The caller should also call PropChanged to notify interested parties.
		///</summary>
		/// <param name='hvoObj'> </param>
		/// <param name='tag'> </param>
		/// <param name='ihvo'> </param>
		/// <param name='chvo'> </param>
		/// <param name='ss'> </param>
		public void InsertNew(int hvoObj, int tag, int ihvo, int chvo, IVwStylesheet ss)
		{
			if (chvo != 1 || tag != StTextTags.kflidParagraphs)
				throw new NotImplementedException("'InsertNew' not implemented yet except for adding one paragraph to a text.");
			IStText text = m_cmObjectRepository.GetObject(hvoObj) as IStText;
			if (text == null)
				throw new InvalidOperationException("'InsertNew' asked to add a paragraph to something that is not an StText");
			IStTxtPara oldPara = text[ihvo];
			int clid = oldPara.ClassID;
			int hvoNew = MakeNewObject(clid, hvoObj, tag, ihvo + 1);
			IStTxtPara newPara = (IStTxtPara)m_cmObjectRepository.GetObject(hvoNew);
			string newStyleName = oldPara.StyleName;
			if (ss != null && !string.IsNullOrEmpty(newStyleName))
			{
				string nextStyleName = ss.GetNextStyle(oldPara.StyleName);
				if (!string.IsNullOrEmpty(nextStyleName))
					newStyleName = nextStyleName;
			}
			if (!string.IsNullOrEmpty(newStyleName))
				newPara.StyleName = newStyleName;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:37,代码来源:DomainDataByFlid.cs


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