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


C# ISilDataAccess.get_IntProp方法代码示例

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


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

示例1: GetBoolean

		/// <summary>
		/// Get the boolean or integer model property as a boolean.
		/// </summary>
		/// <returns>
		/// The regular boolean value for boolean properties.
		/// For int model properties: 'false' for a '0' int value,
		/// or 'true' for all other int values.
		/// </returns>
		public static bool GetBoolean(ISilDataAccess sda, int hvo, int tag)
		{
			if (sda == null) throw new ArgumentNullException("sda");

			return (CellarPropertyType)sda.MetaDataCache.GetFieldType(tag) == CellarPropertyType.Boolean
					? sda.get_BooleanProp(hvo, tag)
					: sda.get_IntProp(hvo, tag) != 0;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:16,代码来源:IntBoolPropertyConverter.cs

示例2: GetValueOfField

		internal virtual int GetValueOfField(ISilDataAccess sda, int hvoField)
		{
			return sda.get_IntProp(hvoField, m_flidSub);
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:4,代码来源:BulkEditBar.cs

示例3: GetBasicPropertyValue

		protected virtual int GetBasicPropertyValue(ISilDataAccess sda, int hvoOwner)
		{
			int type = m_sda.MetaDataCache.GetFieldType(m_flid);
			if (type == (int)CellarPropertyType.Boolean)
				return sda.get_BooleanProp(hvoOwner, m_flid) ? 1 : 0;
			else
				return sda.get_IntProp(hvoOwner, m_flid);
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:8,代码来源:BulkEditBar.cs

示例4: TryToSetLangProjectHvo

		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// Attempts to look up the ownership hierarchy to find the HVO of the language project
		/// to set the m_hvoLangProject member variable.
		/// </summary>
		/// -----------------------------------------------------------------------------------
		private void TryToSetLangProjectHvo(ISilDataAccess sda, int hvo)
		{
			int hvoOwner = sda.get_ObjectProp(hvo, (int)CmObjectFields.kflidCmObject_Owner);
			while (hvoOwner != 0)
			{
				int clsid = sda.get_IntProp(hvoOwner, (int)CmObjectFields.kflidCmObject_Class);
				if (clsid == LangProjectTags.kClassId)
				{
					m_hvoLangProject = hvoOwner;
					return;
				}
				hvoOwner = sda.get_IntProp(hvoOwner, (int)CmObjectFields.kflidCmObject_Owner);
			}
			// Not particularly true in the new architecture, since the WSes are loaded first, so get HVO 1.
			// m_hvoLangProject = 1;	// true 99.999% of the time as of 11/24/2008
			throw new ArgumentException("Probably an ownerless object", "hvo");
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:23,代码来源:FwBaseVc.cs

示例5: StringsFor


//.........这里部分代码省略.........
					{
						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")
						{
							if (whereNode.Name == "otherwise")
								return StringsFor(fdoCache, sda, XmlUtils.GetFirstNonCommentChild(whereNode), hvo, layoutCache, caller, stringTbl, wsForce);
							continue; // ignore any other nodes,typically comments
						}
						// OK, it's a where node.
						if (XmlVc.ConditionPasses(whereNode, hvo, fdoCache, sda, caller))
							return StringsFor(fdoCache, sda, XmlUtils.GetFirstNonCommentChild(whereNode), hvo, layoutCache, caller, stringTbl, wsForce);
					}
					break; // if no condition passes and no otherwise, return null.
				}
				case "if":
				{
					if (XmlVc.ConditionPasses(layout, hvo, fdoCache, sda, caller))
						return StringsFor(fdoCache, sda, XmlUtils.GetFirstNonCommentChild(layout), hvo, layoutCache, caller, stringTbl, wsForce);
					break;
				}
				case "ifnot":
				{
					if (!XmlVc.ConditionPasses(layout, hvo, fdoCache, sda, caller))
						return StringsFor(fdoCache, sda, XmlUtils.GetFirstNonCommentChild(layout), hvo, layoutCache, caller, stringTbl, wsForce);
					break;
				}
				case "lit":
				{
					string literal = layout.InnerText;
					if (stringTbl != null)
					{
						string sTranslate = XmlUtils.GetOptionalAttributeValue(layout, "translate", "");
						if (sTranslate.Trim().ToLower() != "do not translate")
							literal = stringTbl.LocalizeLiteralValue(literal);
					}
					return new[] { literal };
				}
				case "int":
				{
					int flid = GetFlid(sda, layout, hvo);
					int val = sda.get_IntProp(hvo, flid);
					return new[] {AlphaCompNumberString(val)};
				}
				case "datetime":
				{
					int flid = GetFlid(sda, layout, hvo);
					CellarPropertyType itype = (CellarPropertyType)sda.MetaDataCache.GetFieldType(flid);
					if (itype == CellarPropertyType.Time)
					{
						DateTime dt = SilTime.GetTimeProperty(sda, hvo, flid);
						return new[] {DateTimeCompString(dt)};
					}
					else
					{
						string stFieldName = XmlUtils.GetManditoryAttributeValue(layout, "field");
						throw new Exception("Bad field type (" + stFieldName + " for hvo " + hvo + " found for " +
							layout.Name + "  property "	+ flid + " in " + layout.OuterXml);
					}
				}
				case "picture":
					// Treat a picture as a non-empty string for purposes of deciding whether something is empty.
					// This string seems as good as anything for other purposes.
					return new[] {"a picture"};
				default: // unknown or comment node, adds nothing
					Debug.Assert(false, "unrecognized XML node.");
					break;
			}
			return new string[0]; // don't know how to sort, treat as empty key.
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:101,代码来源:XmlViewsUtils.cs

示例6: GetBasicPropertyValue

		protected virtual int GetBasicPropertyValue(ISilDataAccess sda, int hvoOwner)
		{
			return sda.get_IntProp(hvoOwner, m_flid);
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:4,代码来源:BulkEditBar.cs

示例7: GetFlid

		/// <summary>
		/// This is a simplified version of XmlVc.GetFlid.
		/// It does not look for a flid attr, nor try to cache the result.
		/// It looks for a "field" property, and optionally a "class" one, and uses them
		/// (or the class of hvo, if "class" is missing) to figure the flid.
		/// Virtual properties are assumed already created.
		/// </summary>
		/// <param name="sda">The sda.</param>
		/// <param name="frag">The frag.</param>
		/// <param name="hvo">The hvo.</param>
		/// <returns></returns>
		static int GetFlid(ISilDataAccess sda, XmlNode frag, int hvo)
		{
			string stClassName = XmlUtils.GetOptionalAttributeValue(frag,"class");
			string stFieldName = XmlUtils.GetManditoryAttributeValue(frag,"field");
			if (string.IsNullOrEmpty(stClassName))
			{
				int clid = sda.get_IntProp(hvo, CmObjectTags.kflidClass);
				return sda.MetaDataCache.GetFieldId2(clid, stFieldName, true);
			}
			return sda.MetaDataCache.GetFieldId(stClassName, stFieldName, true);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:22,代码来源:XmlViewsUtils.cs

示例8: CollectBrowseItems

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Main (recursive) part of CollectBrowseItems. Given that hvo is to be displayed using node,
		/// figure what objects to put in the list.
		/// </summary>
		/// <param name="hvo">The hvo.</param>
		/// <param name="node">The node.</param>
		/// <param name="collector">The collector.</param>
		/// <param name="mdc">The MDC.</param>
		/// <param name="sda">The sda.</param>
		/// <param name="layouts">The layouts.</param>
		/// <param name="caller">The caller.</param>
		/// <param name="hvos">The hvos.</param>
		/// <param name="flids">The flids.</param>
		/// ------------------------------------------------------------------------------------
		static void CollectBrowseItems(int hvo, XmlNode node, ArrayList collector,
			IFwMetaDataCache mdc, ISilDataAccess sda, LayoutCache layouts, XmlNode caller, int[] hvos, int[] flids)
		{
			switch(node.Name)
			{
			case "obj":
			{
				int clsid = sda.get_IntProp(hvo, CmObjectTags.kflidClass);
				int flid = mdc.GetFieldId2(clsid, XmlUtils.GetManditoryAttributeValue(node, "field"), true);
				int hvoDst = sda.get_ObjectProp(hvo, flid);
				if (hvoDst == 0)
				{
					// We want a row, even though it's blank for this column.
					collector.Add(new ManyOnePathSortItem(hvo, hvos, flids));
					return;
				}
				// At this point we have to mimic the process that XmlVc uses to come up with the
				// node that will be used to process the destination item.
				XmlNode dstNode = GetNodeForRelatedObject(hvoDst, caller, node, layouts, sda);
				if (dstNode == null)
				{
					// maybe an old-style "frag" element? Anyway, we can't do anything smart,
					// so just insert the original object.
					collector.Add(new ManyOnePathSortItem(hvo, hvos, flids));
					return;
				}
				CollectBrowseItems(hvoDst, dstNode, collector, mdc, sda, layouts, null, AppendInt(hvos, hvo), AppendInt(flids, flid));
			}
				break;
			case "seq":
			{
				// very like "obj" except for the loop. How could we capture this?
				int clsid = sda.get_IntProp(hvo, CmObjectTags.kflidClass);
				int flid = mdc.GetFieldId2(clsid, XmlUtils.GetManditoryAttributeValue(node, "field"), true);
				int chvo = sda.get_VecSize(hvo, flid);
				if (chvo == 0)
				{
					// We want a row, even though it's blank for this column.
					collector.Add(new ManyOnePathSortItem(hvo, hvos, flids));
					return;
				}
				for (int ihvo = 0; ihvo < chvo; ihvo++)
				{
					int hvoDst = sda.get_VecItem(hvo, flid, ihvo);
					// At this point we have to mimic the process that XmlVc uses to come up with the
					// node that will be used to process the destination item.
					XmlNode dstNode = GetNodeForRelatedObject(hvoDst, caller, node, layouts, sda);
					if (dstNode == null)
					{
						if (ihvo == 0)
						{
							// maybe an old-style "frag" element? Anyway, we can't do anything smart,
							// so just insert the original object.
							collector.Add(new ManyOnePathSortItem(hvo, hvos, flids));
							return;
						}
						// if this happens and it's not the first object, we have a funny mixture of modes.
						// As a fall-back, skip this object.
						continue;
					}
					CollectBrowseItems(hvoDst, dstNode, collector, mdc, sda, layouts, null, AppendInt(hvos, hvo), AppendInt(flids, flid));
				}
			}
				break;
			case "span":
			case "para":
			case "div":
			case "concpara":
			case "innerpile":
			case "column":
				// Review JohnT: In XmlVc, "part" is the one thing that calls ProcessChildren with non-null caller.
				// this should make some difference here, but I can't figure what yet, or come up with a test that fails.
			case "part":
			case "layout":
				// These are grouping nodes. In general this terminates things. However, if there is only
				// one thing embedded apart from comments and properties, we can proceed.
				XmlNode mainChild = FindMainChild(node);
				if (mainChild == null)
				{
					// no single non-trivial child, keep our current object
					collector.Add(new ManyOnePathSortItem(hvo, hvos, flids));
					return;
				}
				// Recurse with same object, but process the 'main child'.
				CollectBrowseItems(hvo, mainChild, collector, mdc, sda, layouts, caller, hvos, flids);
//.........这里部分代码省略.........
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:101,代码来源:XmlViewsUtils.cs

示例9: GetDisplayCommandForColumn1

		/// <summary>
		/// Recursive implementation method for GetDisplayCommandForColumn.
		/// </summary>
		/// <param name="bvi"></param>
		/// <param name="node"></param>
		/// <param name="mdc"></param>
		/// <param name="sda"></param>
		/// <param name="layouts"></param>
		/// <param name="depth"></param>
		/// <param name="hvo"></param>
		/// <param name="collectOuterStructParts"></param>
		/// <returns></returns>
		static NodeDisplayCommand GetDisplayCommandForColumn1(IManyOnePathSortItem bvi, XmlNode node,
			IFwMetaDataCache mdc, ISilDataAccess sda, LayoutCache layouts, int depth,
			out int hvo, List<XmlNode> collectOuterStructParts)
		{
			hvo = bvi.PathObject(depth); // default
			switch(node.Name)
			{
			case "obj":
			case "seq":
			{
				// These two cases are the same here, because if the field matches, the object
				// that determines the next step comes from the bvi, not from one or many items
				// in the property.

				if (bvi.PathLength == depth)
				{
					// No more path, we display the final object using the node we've deduced is
					// appropriate for it.
					// (We could put this test outside the switch. But then we don't dig into
					// layout, para, span, etc elements at the end of the chain. It's more
					// consistent if we always dig as deep as we can.
					hvo = bvi.KeyObject;
					return new NodeDisplayCommand(node);
				}

				int clsid = sda.get_IntProp(bvi.PathObject(depth), CmObjectTags.kflidClass);
				int flid = mdc.GetFieldId2(clsid, XmlUtils.GetManditoryAttributeValue(node, "field"), true);
				if (flid != bvi.PathFlid(depth))
					return new NodeDisplayCommand(node); // different field, can't dig deeper.
				int hvoDst = bvi.PathObject(depth + 1);
				// If the path object has been deleted, fall back to displaying whatever the property currently holds.
				if (sda.get_IntProp(hvoDst, CmObjectTags.kflidClass) == 0)
					return new NodeDisplayCommand(node); // different field, can't dig deeper.
				// At this point we have to mimic the process that XmlVc uses to come up with the
				// node that will be used to process the destination item.
				XmlNode dstNode = GetNodeForRelatedObject(hvoDst, null, node, layouts, sda);
				return GetDisplayCommandForColumn1(bvi, dstNode, mdc, sda, layouts, depth + 1, out hvo, collectOuterStructParts);
			}
			case "para":
			case "span":
			case "div":
			case "concpara":
			case "innerpile":
			{
				XmlNode mainChild = FindMainChild(node);
				if (mainChild == null)
					return new NodeDisplayCommand(node); // can't usefully go further.
				if (collectOuterStructParts != null)
					collectOuterStructParts.Add(node);
				return GetDisplayCommandForColumn1(bvi, mainChild, mdc, sda, layouts, depth, out hvo, collectOuterStructParts);
			}
				// Review JohnT: In XmlVc, "part" is the one thing that calls ProcessChildren with non-null caller.
				// this should make some difference here, but I can't figure what yet, or come up with a test that fails.
				// We may need a "caller" argument to pass this down so it can be used in GetNodeForRelatedObject.
			case "part":
			{
				string layoutName = XmlUtils.GetOptionalAttributeValue(node, "ref");
				if (layoutName != null)
				{
					// It's actually a part ref, in a layout, not a part looked up by one!
					// Get the node it refers to, and make a command to process its children.
					XmlNode part = XmlVc.GetNodeForPart(hvo, layoutName, false, sda, layouts);
					if (part != null)
						return new NodeChildrenDisplayCommand(part); // display this object using the children of the part referenced.
					else
						return new NodeDisplayCommand(node); // no matching part, do default.
				}

				// These are almost the same, but are never added to collectOuterStructParts.
				// Also, expecially in the case of 'layout', they may result from unification, and be meaningless
				// except for their children; in any case, the children are all we want to process.
				// This is the main reason we return a command, not just a node: this case has to return the subclass.
				XmlNode mainChild = FindMainChild(node);
				if (mainChild == null)
					return new NodeChildrenDisplayCommand(node); // can't usefully go further.
				return GetDisplayCommandForColumn1(bvi, mainChild, mdc, sda, layouts, depth, out hvo, collectOuterStructParts);
			}
			case "column":
			case "layout":
			{

				// These are almost the same as para, span, etc, but are never added to collectOuterStructParts.
				// Also, expecially in the case of 'layout', they may result from unification, and be meaningless
				// except for their children; in any case, the children are all we want to process.
				// This is the main reason we return a command, not just a node: this case has to return the subclass.
				XmlNode mainChild = FindMainChild(node);
				if (mainChild == null)
					return new NodeChildrenDisplayCommand(node); // can't usefully go further.
//.........这里部分代码省略.........
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:101,代码来源:XmlViewsUtils.cs

示例10: TryToSetLangProjectHvo

		private void TryToSetLangProjectHvo(ISilDataAccess sda, int hvo)
		{
			int hvoOwner = sda.get_IntProp(hvo, (int)CmObjectFields.kflidCmObject_Owner);
			while (hvoOwner != 0)
			{
				int clsid = sda.get_IntProp(hvoOwner, (int)CmObjectFields.kflidCmObject_Class);
				if (clsid == (int)LangProject.kclsidLangProject)
				{
					m_hvoLangProject = hvoOwner;
					return;
				}
				hvoOwner = sda.get_IntProp(hvoOwner, (int)CmObjectFields.kflidCmObject_Owner);
			}
			m_hvoLangProject = 1;	// true 99.999% of the time as of 11/24/2008
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:15,代码来源:VwBaseVc.cs

示例11: IsListRef

		/// <summary>
		/// Return true if the CCA is a CmBaseAnnotation (which in a CCA list makes it
		/// a reference to a CmPossibility), also known as a generic marker.
		/// </summary>
		/// <param name="hvoCca"></param>
		/// <returns></returns>
		private static bool IsListRef(ISilDataAccess sda, int hvoCca)
		{
			int clsid = sda.get_IntProp(hvoCca, (int)CmObjectFields.kflidCmObject_Class);
			return clsid == CmBaseAnnotation.kclsidCmBaseAnnotation;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:11,代码来源:ConstChartBody.cs


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