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


C# ISilDataAccess.get_IsPropInCache方法代码示例

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


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

示例1: GetItems

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Get all the possibilities (or subpossibiities) of the owner and (optionally their
		/// subpossibilities).
		/// </summary>
		/// <param name="hvoOwn">The hvo own.</param>
		/// <param name="flid">flid for Possibilities for a CmPossibilityList, or
		/// SubPossibilities for a CmPossibility</param>
		/// <param name="list">list of ids to return.</param>
		/// <param name="sda">The sda.</param>
		/// <param name="fGetAllDescendants">if true, recurse to get ALL subpossibilities.</param>
		/// ------------------------------------------------------------------------------------
		private static void GetItems(int hvoOwn, int flid, Set<int> list, ISilDataAccess sda,
			bool fGetAllDescendants)
		{
			int flidPss = (int)CellarModuleDefns.kflidCmPossibility_SubPossibilities;
			int chvo = 0;
			// Note, calling get_VecSize directly will result in a SQL query for all of the nodes of
			// the tree to verify that they are zero. This generates around 1400 queries for the
			// semantic domain list during loading. These will likely never be needed for anything
			// else, so it simply wastes time.
			if (sda.get_IsPropInCache(hvoOwn, flid, (int)FieldType.kcptOwningCollection, 0))
				chvo = sda.get_VecSize(hvoOwn, flid);
			for (int ihvo = 0; ihvo < chvo; ++ihvo)
			{
				int hvo = sda.get_VecItem(hvoOwn, flid, ihvo);
				list.Add(hvo);
				if (fGetAllDescendants)
					CmPossibility.GetItems(hvo, flidPss, list, sda, fGetAllDescendants);
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:31,代码来源:CellarOverrides.cs

示例2: IsPropInCache

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Determines whether our Tag has been stored in the cache for the given hvo and ws.
		/// </summary>
		/// <param name="sda">The sda.</param>
		/// <param name="hvo">hvo owner of Tag</param>
		/// <param name="ws">0, if the Tag does not relate to ws.</param>
		/// <returns><c>true</c> if the prop is in the cache; otherwise, <c>false</c>.</returns>
		/// ------------------------------------------------------------------------------------
		public bool IsPropInCache(ISilDataAccess sda, int hvo, int ws)
		{
			return sda.get_IsPropInCache(hvo, this.Tag, this.Type, ws);
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:13,代码来源:BaseVirtualHandler.cs

示例3: CacheObjPropUndoAction

		/// <summary>
		/// Make one AND make the change to the cache.
		/// </summary>
		/// <param name="sda"></param>
		/// <param name="hvo"></param>
		/// <param name="flid"></param>
		/// <param name="newValue"></param>
		public CacheObjPropUndoAction(ISilDataAccess sda, int hvo, int flid, int newValue)
		{
			m_sda = sda;
			m_hvo = hvo;
			m_flid = flid;
			m_newValue = newValue;
			m_oldValue = 0;
			// Since this is used for fake props, if it isn't already cached, it doesn't have an old value.
			if (sda.get_IsPropInCache(hvo, flid, (int)CellarModuleDefns.kcptReferenceAtom, 0))
				m_oldValue = sda.get_ObjectProp(hvo, flid);
			DoIt(m_newValue);
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:19,代码来源:FdoUndoActions.cs

示例4: RecomputeVirtuals

		/// <summary>
		/// If object hvo has no cached value for the property flidVirtual, do nothing.
		/// Otherwise, compute a new value for the property, and issue a PropChanged. (Currently only string type supported)
		/// If it has owning properties of type clidVirtual, do the same for all their items.
		/// </summary>
		/// <param name="hvo"></param>
		/// <param name="flidVirtual"></param>
		/// <param name="mdc"></param>
		/// <param name="sda"></param>
		private void RecomputeVirtuals(int hvo, uint clidVirtual, int flidVirtual, int typeVirtual, IFwMetaDataCache mdc, ISilDataAccess sda,
			IVwVirtualHandler vh)
		{
			if (Cache.GetClassOfObject(hvo) != clidVirtual)
				return;
			// Unless it's a computeEveryTime property, we don't need to worry if it's not already cached.
			if (vh.ComputeEveryTime || sda.get_IsPropInCache(hvo, flidVirtual, typeVirtual, 0))
			{
				vh.Load(hvo, flidVirtual, 0, Cache.VwCacheDaAccessor);
				switch (typeVirtual)
				{
					case (int)CellarModuleDefns.kcptString:
						sda.PropChanged(null, (int)PropChangeType.kpctNotifyAll, hvo, flidVirtual, 0, 0, 0);
						break;
					default:
						Debug.WriteLine("RecomputeVirtuals: unimplemented prop type");
						break;
				}
			}
			uint[] flids = DbOps.GetFieldsInClassOfType(mdc, (int)clidVirtual, FieldType.kgrfcptOwning);
			foreach (uint flid in flids)
			{
				int type = mdc.GetFieldType(flid);
				if (type == (int)CellarModuleDefns.kfcptOwningAtom)
				{
					RecomputeVirtuals(sda.get_ObjectProp(hvo, (int)flid), clidVirtual, flidVirtual, typeVirtual, mdc, sda, vh);
				}
				else
				{
					// must be owning sequence or collection; do them all.
					int chvo = sda.get_VecSize(hvo, (int)flid);
					for (int i = 0; i < chvo; i++)
						RecomputeVirtuals(sda.get_VecItem(hvo, (int)flid, i), clidVirtual, flidVirtual, typeVirtual, mdc, sda, vh);

				}
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:46,代码来源:Slice.cs


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