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


C# FdoCache.GetClassAndPropInfo方法代码示例

本文整理汇总了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);
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:56,代码来源:BaseVirtualHandler.cs


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