本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
}
}