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


C# FdoCache.GetOwningFlidOfObject方法代码示例

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


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

示例1: IsScripturePara

		/// <summary>
		/// Test whether a particular StTxtPara is part of Scripture.
		/// </summary>
		/// <param name="hvoPara"></param>
		/// <param name="cache"></param>
		/// <returns></returns>
		public static bool IsScripturePara(int hvoPara, FdoCache cache)
		{
			int flidOfOwnerOfSttext = cache.GetOwningFlidOfObject(cache.GetOwnerOfObject(hvoPara));
			return Scripture.Scripture.IsScriptureTextFlid(flidOfOwnerOfSttext);
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:11,代码来源:ScrTxtPara.cs

示例2: CheckAndReportBadTagListAdd

		private static bool CheckAndReportBadTagListAdd(FdoCache cache, int hvoItem, int hvoRootItem, int hvoPossList)
		{
			if (cache.GetOwningFlidOfObject(hvoPossList) != (int) LangProject.LangProjectTags.kflidTextMarkupTags)
				return false; // some other list we don't care about.

			// Confirm the two-level rule.
			if (hvoItem != hvoRootItem)
			{
				MessageBox.Show(FdoUiStrings.ksMarkupTagsTooDeep,
								FdoUiStrings.ksHierarchyLimit, MessageBoxButtons.OK, MessageBoxIcon.Warning);
				return true;
			}
			return false;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:14,代码来源:FdoUiCore.cs

示例3: CheckAndReportBadDiscourseTemplateAdd

		private static bool CheckAndReportBadDiscourseTemplateAdd(FdoCache cache, int hvoItem, int hvoRootItem, int hvoList)
		{
			if (cache.GetOwningFlidOfObject(hvoList) != (int)DsDiscourseData.DsDiscourseDataTags.kflidConstChartTempl)
				return false; // some other list we don't care about.
			// We can't turn a column into a group if it's in use.
			CmPossibility col = CmPossibility.CreateFromDBObject(cache, hvoItem) as CmPossibility;
			// If the item doesn't already have children, we can only add them if it isn't already in use
			// as a column: we don't want to change a column into a group. Thus, if there are no
			// children, we generally call the same routine as when deleting.
			// However, that routine has a special case to prevent deletion of the default template even
			// if NOT in use...and we must not prevent adding to that when it is empty! Indeed any
			// empty CHART can always be added to, so only if col's owner is a CmPossibility (it's not a root
			// item in the templates list) do we need to check for it being in use.
			if (col.SubPossibilitiesOS.Count == 0 && col.Owner is CmPossibility && col.CheckAndReportProtectedChartColumn())
				return true;
			// Finally, we have to confirm the two-level rule.
			if (hvoItem != hvoRootItem && cache.GetOwnerOfObject(hvoItem) != hvoRootItem)
			{
				MessageBox.Show(FdoUiStrings.ksTemplateTooDeep,
								FdoUiStrings.ksHierarchyLimit, MessageBoxButtons.OK, MessageBoxIcon.Warning);
				return true;
			}
			return false;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:24,代码来源:FdoUiCore.cs

示例4: ConvertDummyToReal

		/// <summary>
		/// Takes the information from a dummy object and allows its owner to create a real object in the database.
		/// NOTE: after calling this, users need to make sure they no longer try to use the old hvoDummy object.
		/// </summary>
		/// <param name="fcCache"></param>
		/// <param name="hvoDummy">id corresponding to the object to convert. Minimally it should have a class id cached
		/// and an OwningFlid corresponding to a virtual handler that implements IDummyRequestConversion. </param>
		/// <returns>real object based on new database entry created for the dummy object,
		/// null if conversion did not take place.</returns>
		public static ICmObject ConvertDummyToReal(FdoCache fcCache, int hvoDummy)
		{
			// suppress changes in display.
			using (new IgnorePropChanged(fcCache, PropChangedHandling.SuppressView))
			{
				// This conversion should not be an undoable task, so suppress the action handler.
				// (cf. LT-5330, LT-5417).
				using (SuppressSubTasks supressActionHandler = new SuppressSubTasks(fcCache, true))
				{
					ICmObject realObj = null;
					Debug.Assert(fcCache.IsDummyObject(hvoDummy));
					if (fcCache.IsDummyObject(hvoDummy))
					{
						// see if we can convert this to a real object before loading it.
						int owningFlid = fcCache.GetOwningFlidOfObject(hvoDummy);
						IVwVirtualHandler vh = fcCache.VwCacheDaAccessor.GetVirtualHandlerId(owningFlid);
						Debug.Assert(vh != null && vh is IDummyRequestConversion);
						if (vh != null && vh is IDummyRequestConversion)
						{
							RequestConversionToRealEventArgs args = new RequestConversionToRealEventArgs(hvoDummy,
								0, null, true);
							args.OwningFlid = owningFlid;
							(vh as IDummyRequestConversion).OnRequestConversionToReal(hvoDummy, args);
							realObj = args.RealObject as ICmObject;
						}
					}
					return realObj;
				}
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:39,代码来源:CmObject.cs


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