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


C# ISilDataAccess.VecProp方法代码示例

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


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

示例1: StringsFor


//.........这里部分代码省略.........
					// 'caller' for all embedded nodes in the called part.
					return StringsFor(fdoCache, sda, part, hvo, layoutCache, layout, stringTbl, wsForce);
				}
				case "div":
				case "innerpile":
				{
					// Concatenate keys for child nodes (as distinct strings)
					return ChildKeys(fdoCache, sda, layout, hvo, layoutCache, caller, stringTbl, wsForce);
				}
				case "obj":
				{
					// Follow the property, get the object, look up the layout to use,
					// invoke recursively.
					int flid = GetFlid(sda, layout, hvo);
					int hvoTarget = sda.get_ObjectProp(hvo, flid);
					if (hvoTarget == 0)
						break; // return empty key
					string targetLayoutName = XmlUtils.GetOptionalAttributeValue(layout, "layout"); // uses 'default' if missing.
					XmlNode layoutTarget = GetLayoutNodeForChild(sda, hvoTarget, flid, targetLayoutName, layout, layoutCache);
					if (layoutTarget == null)
						break;
					return ChildKeys(fdoCache, sda, layoutTarget, hvoTarget, layoutCache, caller, stringTbl, wsForce);
				}
				case "seq":
				{
					// Follow the property. For each object, look up the layout to use,
					// invoke recursively, concatenate
					int flid = GetFlid(sda, layout, hvo);
					int[] contents;
					int ctarget = sda.get_VecSize(hvo, flid);
					using (ArrayPtr arrayPtr = MarshalEx.ArrayToNative<int>(ctarget))
					{
						int chvo;
						sda.VecProp(hvo, flid, ctarget, out chvo, arrayPtr);
						contents = MarshalEx.NativeToArray<int>(arrayPtr, chvo);
					}

					string[] result = null;
					string targetLayoutName = XmlVc.GetLayoutName(layout, caller); // also allows for finding "param" attr in caller, if not null
					int i = 0;
					foreach (int hvoTarget in contents)
					{
						int prevResultLength = GetArrayLength(result);
						XmlNode layoutTarget = GetLayoutNodeForChild(sda, hvoTarget, flid, targetLayoutName, layout, layoutCache);
						if (layoutTarget == null)
							continue; // should not happen, but best recovery we can make
						result = Concatenate(result, ChildKeys(fdoCache, sda, layoutTarget, hvoTarget, layoutCache, caller, stringTbl, wsForce));
						// add a separator between the new childkey group and the previous childkey group
						if (i > 0 && prevResultLength != GetArrayLength(result) && prevResultLength > 0)
						{
							int ichIns = 0;
							if (result[prevResultLength - 1] != null)
								ichIns = result[prevResultLength - 1].Length;
							AddSeparator(ref result[prevResultLength - 1],  ichIns, layout);
						}
						++i;
					}

					return result;
				}
				case "choice":
				{
					foreach(XmlNode whereNode in layout.ChildNodes)
					{
						if (whereNode.Name != "where")
						{
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:67,代码来源:XmlViewsUtils.cs

示例2: ExportLift

		/// <summary>
		/// Export the lexicon entries filtered into the list given by flid with relation to
		/// the LexDb object.
		/// </summary>
		public void ExportLift(TextWriter w, string folderPath, ISilDataAccess sda, int flid)
		{
			var hvoObject = m_cache.LangProject.LexDbOA.Hvo;
			var chvo = sda.get_VecSize(hvoObject, flid);
			int[] contents;
			using (var arrayPtr = MarshalEx.ArrayToNative<int>(chvo))
			{
				sda.VecProp(hvoObject, flid, chvo, out chvo, arrayPtr);
				contents = MarshalEx.NativeToArray<int>(arrayPtr, chvo);
			}
			var entries = FilterVirtualFlidVector(contents);
			ExportLift(w, folderPath, entries, entries.Count);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:17,代码来源:LiftExporter.cs

示例3: GetVector

		/// <summary>
		/// Get the items from a vector property.
		/// </summary>
		private static int[] GetVector(ISilDataAccess sda, int hvo, int tag)
		{
			var chvo = sda.get_VecSize(hvo, tag);
			using (ArrayPtr arrayPtr = MarshalEx.ArrayToNative<int>(chvo))
			{
				sda.VecProp(hvo, tag, chvo, out chvo, arrayPtr);
				return MarshalEx.NativeToArray<int>(arrayPtr, chvo);
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:12,代码来源:XmlVcDisplayVec.cs


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