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


C# ITsTextProps.GetStrProp方法代码示例

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


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

示例1: ClassesFromTsTextProps

 public static List<string> ClassesFromTsTextProps(ITsTextProps props, int[] intPropsToSkip, int[] strPropsToSkip)
 {
     var classes = new List<string>();
     for (int i = 0, n = props.IntPropCount; i < n; i++)
     {
         int propNum;
         int variation;
         int propValue = props.GetIntProp(i, out propNum, out variation);
         if (intPropsToSkip.Contains(propNum))
             continue;
         string className = String.Format("propi_{0}_{1}_{2}_{3}", propNum, IntPropertyName(propNum), propValue, variation);
         classes.Add(className);
     }
     for (int i = 0, n = props.StrPropCount; i < n; i++)
     {
         int propNum;
         string propValue = props.GetStrProp(i, out propNum).Replace(" ", "_SPACE_");
         string className = String.Format("props_{0}_{1}_{2}", propNum, StringPropertyName(propNum), propValue);
         if (strPropsToSkip.Contains(propNum))
             continue;
         classes.Add(className);
     }
     return classes;
 }
开发者ID:ermshiperete,项目名称:LfMerge,代码行数:24,代码来源:ConvertFdoToMongoTsStrings.cs

示例2: spyOnTextProps

		private void spyOnTextProps(ITsTextProps ttp)
		{
			int tpt; // ??

			// look at integer props
			int cintProps = ttp.IntPropCount;
			for (int i = 0; i < cintProps; i++)
			{
				int nVar;
				int intProp = ttp.GetIntProp(i, out tpt, out nVar);
				int Value = ttp.GetIntPropValues(tpt, out nVar);
				Value = 34; // need something so Value can be looked at
			}

			// look at string props
			int cstrProps = ttp.StrPropCount;
			for (int i = 0; i < cstrProps; i++)
			{
				string strProp = ttp.GetStrProp(i, out tpt);
				string Value = ttp.GetStrPropValue(tpt);
				Value = "why?"; // need something so Value can be looked at
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:23,代码来源:SelectText.cs

示例3: TextStrPropInfo

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:TextStrPropInfo"/> class.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public TextStrPropInfo(ITsTextProps props, int iprop)
		{
			int tpt;
			Value = props.GetStrProp(iprop, out tpt);
			Type = (FwTextPropType)tpt;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:11,代码来源:FdoInspectorList.cs

示例4: PropsAreEqual

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Compares two TsTextProps
		/// </summary>
		/// <param name="ttp1">expected</param>
		/// <param name="ttp2">actual</param>
		/// <param name="sHowDifferent">Human(geek)-readable string telling how the props are
		/// different, or indicating no difference</param>
		/// <returns>True if they contain the same props, false otherwise</returns>
		/// ------------------------------------------------------------------------------------
		public static bool PropsAreEqual(ITsTextProps ttp1, ITsTextProps ttp2,
			out string sHowDifferent)
		{
			// check how intProps compare
			int cProps1 = ttp1.IntPropCount;
			int cProps2 = ttp2.IntPropCount;
			int tpv1, tpv2; // prop values
			int nVar1, nVar2; // variation info
			int tpt; // prop type
			for (int iprop = 0; iprop < cProps1; iprop++)
			{
				tpv1 = ttp1.GetIntProp(iprop, out tpt, out nVar1);
				tpv2 = ttp2.GetIntPropValues(tpt, out nVar2);

				if (tpv1 != tpv2 || nVar1 != nVar2)
				{
					if (tpt == (int)FwTextPropType.ktptWs)
						sHowDifferent = string.Format("Props differ in ktptWs property. "
							+ "Expected <{0}>, but was <{1}>.", tpv1, tpv2);
					else
						sHowDifferent = string.Format("Props differ in intProp type {0}. "
							+ "Expected <{1},{2}>, but was <{3},{4}>.", tpt, tpv1, nVar1, tpv2, nVar2);
					return false;
				}
			}
			// if count of intProps differs, it will be difficult to report exact difference
			//  so just issue a simple response for now
			if (cProps1 != cProps2)
			{
				sHowDifferent = string.Format("Props differ in count of intProps. "
					+ "Expected <{0}>, but was <{1}>.", cProps1, cProps2);
				return false;
			}

			// check for string properties differences
			int s1count = ttp1.StrPropCount;
			int s2count = ttp2.StrPropCount;
			int strtype;
			string strval1, strval2; // prop values
			for (int iprop = 0; iprop < s1count; iprop++)
			{
				strval1 = ttp1.GetStrProp(iprop, out strtype);
				strval2 = ttp2.GetStrPropValue(strtype);

				if (strval1 != strval2)
				{
					if (strtype == (int)FwTextPropType.ktptNamedStyle)
						sHowDifferent = string.Format("Props differ in ktptNamedStyle property. "
							+ "Expected <{0}>, but was <{1}>.", strval1, strval2);
					else if (strtype == (int)FwTextPropType.ktptObjData)
						sHowDifferent = string.Format("Props differ in ktptObjData property. "
							+ "Expected <{0}>, but was <{1}>.", strval1, strval2);
							// we could detail the objectDataType and Guid if needed
					else
						sHowDifferent = string.Format("Props differ in strProp type {0}. "
							+ "Expected <{1}>, but was <{2}>.", strtype, strval1, strval2);
					return false;
				}
			}
			// if count of strProps differs, it will be difficult to report exact difference
			//  so just issue a simple response for now
			if (s1count != s2count)
			{
				sHowDifferent = string.Format("Props differ in count of strProps. "
					+ "Expected <{0}>, but was <{1}>.", s1count, s2count);
				return false;
			}

			// if we reach this point, no differences were found
			sHowDifferent = "TextProps objects appear to contain the same properties.";
			return true;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:82,代码来源:TsTextPropsHelper.cs


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