本文整理汇总了C#中SIL.FieldWorks.FDO.FdoCache.GetClassAndPropInfo方法的典型用法代码示例。如果您正苦于以下问题:C# FdoCache.GetClassAndPropInfo方法的具体用法?C# FdoCache.GetClassAndPropInfo怎么用?C# FdoCache.GetClassAndPropInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SIL.FieldWorks.FDO.FdoCache
的用法示例。
在下文中一共展示了FdoCache.GetClassAndPropInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupDependencies
/// <summary>
/// Setup DependencyPaths property
/// </summary>
/// <param name="configuration"></param>
/// <param name="cache"></param>
protected void SetupDependencies(XmlNode configuration, FdoCache cache)
{
if (DependencyPaths.Count > 0)
return; // already setup.
string dependsStr = XmlUtils.GetOptionalAttributeValue(configuration, "depends");
if (dependsStr == null || cache == null)
return;
string[] depends = dependsStr.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
foreach (string fieldPath in depends)
{
string[] fieldtree = fieldPath.Split(new char[] { '.' });
List<int> tags = new List<int>(fieldtree.Length);
string srcClassName = this.ClassName;
foreach (string field in fieldtree)
{
int tag = cache.GetFlid(0, srcClassName, field);
Debug.Assert(tag > 0, String.Format("Invalid dependency field {0} in field path {1}.", field, fieldPath));
if (tag <= 0)
break;
tags.Add(tag);
if (tags.Count < fieldtree.Length)
{
string nextFieldName = fieldtree[tags.Count];
// make dst class the source class of next field
uint clsidDst = 0;
if (field == "OwnerHVO")
{
// handle the special case where we need the owning class
// this is only possible if srcClassName is has a unique owner.
// find the first class that owns the given 'classId' and the given fieldName.
clsidDst = GetClassOwningClassAndFieldName(cache, srcClassName, nextFieldName);
}
else
{
ClassAndPropInfo cpi = cache.GetClassAndPropInfo((uint)tag);
if (ClassHasField(cache, cache.GetClassName(cpi.signatureClsid), nextFieldName))
{
clsidDst = cpi.signatureClsid;
}
else if (cpi.isAbstract)
{
// find a subclasses that could refer to the nextFieldName.
clsidDst = GetSubclassOwningNextField(cache, tag, nextFieldName);
}
}
srcClassName = cache.GetClassName(clsidDst);
}
}
m_fieldPaths.Add(tags);
}
}