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


C# FdoCache.GetTypeInAssembly方法代码示例

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


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

示例1: GetTypeFromFWClassID

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// gives the CSharp type corresponding to the given the fieldworks class ID
		/// </summary>
		/// <param name="fcCache"></param>
		/// <param name="iClassId"></param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		public static Type GetTypeFromFWClassID(FdoCache fcCache, int iClassId)
		{
			//CmObject is a special case because it is not part of a module.
			if (iClassId == CmObject.kClassId)
				return typeof(CmObject);
			// if the class ID is cached then return the type now.
			if (s_classIdToType.ContainsKey(iClassId))
				return s_classIdToType[iClassId];

			Type t = null;
			// Find the class name of this object
			string sClassName = fcCache.GetClassName((uint)iClassId);
			// find the Type for this class, which is painful 'cause we don't know the namespace
			string[] modules = new string[]{"Cellar", "Ling", "Scripture", "FeatSys", "LangProj", "Notebk"};
			foreach(string moduleName in modules)
			{
				string fullTypeName = string.Format("SIL.FieldWorks.FDO.{0}.{1}", moduleName, sClassName);
				t = fcCache.GetTypeInAssembly(fullTypeName);
				//t = Assembly.GetExecutingAssembly().GetType(fullTypeName, false, false);
				if (t != null)
					break;
			}
			Debug.Assert(t != null);

			// cache the type info and return it.
			s_classIdToType.Add(iClassId, t);
			return t;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:36,代码来源:CmObject.cs

示例2: GetTypeFromFullClassName

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// returns the CSharp type corresponding to be fully qualified name given
		/// </summary>
		/// <param name="cache">The cache.</param>
		/// <param name="sFullClassName">e.g. "SIL.FieldWorks.FDO.Ling.WordformLookupList"</param>
		/// <returns>the CSharp type</returns>
		/// ------------------------------------------------------------------------------------
		public static Type GetTypeFromFullClassName(FdoCache cache, string sFullClassName)
		{
			Type t = cache.GetTypeInAssembly(sFullClassName);
			Debug.Assert(t != null);
			return t;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:14,代码来源:CmObject.cs


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