本文整理汇总了C#中SIL.FieldWorks.FDO.FdoCache.IsReferenceProperty方法的典型用法代码示例。如果您正苦于以下问题:C# FdoCache.IsReferenceProperty方法的具体用法?C# FdoCache.IsReferenceProperty怎么用?C# FdoCache.IsReferenceProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SIL.FieldWorks.FDO.FdoCache
的用法示例。
在下文中一共展示了FdoCache.IsReferenceProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanInsertFieldIntoObj
/// <summary>
/// Check if the field can be inserted into the given object.
/// </summary>
/// <param name="fdoCache"></param>
/// <param name="fieldName">name of the field to be inserted</param>
/// <param name="parentObj">The object where the item would be inserted, if possible.</param>
/// <param name="index">index (0-based) where it will be inserted. -1 if atomic or returns false</param>
/// <returns>true if we can insert into the given object</returns>
protected bool CanInsertFieldIntoObj(FdoCache fdoCache, string fieldName, ICmObject parentObj, out int index)
{
index = -1; // atomic or not possible
if (fdoCache == null || parentObj == null || (!parentObj.IsValidObject) || String.IsNullOrEmpty(fieldName))
return false;
var mdc = fdoCache.ServiceLocator.GetInstance<IFwMetaDataCacheManaged>();
// class not specified, depends on the object we're testing.
int flid = GetFlidIfPossible(parentObj.ClassID, fieldName, mdc);
if (flid == 0)
return false; // Some kind of fake field, or wrong type of object, so bail out.
var type = (CellarPropertyType) mdc.GetFieldType(flid);
// we can only insert new objects into virtual reference properties
if (fdoCache.IsReferenceProperty(flid) && !mdc.get_IsVirtual(flid))
return false;
if (type == CellarPropertyType.OwningSequence ||
type == CellarPropertyType.OwningCollection ||
type == CellarPropertyType.ReferenceCollection ||
type == CellarPropertyType.ReferenceSequence)
{
index = fdoCache.DomainDataByFlid.get_VecSize(parentObj.Hvo, flid);
return true;
}
// if its an atomic field, see if it's already been filled.
if (type == CellarPropertyType.OwningAtomic || type == CellarPropertyType.ReferenceAtomic)
{
return fdoCache.DomainDataByFlid.get_ObjectProp(parentObj.Hvo, flid) == 0;
}
return false;
}
示例2: ReferenceBaseUi
public ReferenceBaseUi(FdoCache cache, ICmObject rootObj, int referenceFlid, int targetHvo)
{
// determine whether this is an atomic or vector relationship.
Debug.Assert(cache.IsReferenceProperty(referenceFlid));
Debug.Assert(rootObj != null);
m_cache = cache;
m_hvo = rootObj.Hvo;
m_obj = rootObj;
m_flid = referenceFlid;
m_hvoTarget = targetHvo;
m_targetUi = MakeUi(m_cache, m_hvoTarget);
}