本文整理汇总了C#中ITypesInfo.LoadTypes方法的典型用法代码示例。如果您正苦于以下问题:C# ITypesInfo.LoadTypes方法的具体用法?C# ITypesInfo.LoadTypes怎么用?C# ITypesInfo.LoadTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITypesInfo
的用法示例。
在下文中一共展示了ITypesInfo.LoadTypes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CollectStuff
private void CollectStuff(ITypesInfo typesInfo) {
foreach (ModuleBase module in Modules) {
Assembly assembly = module.GetType().Assembly;
assemblyHash[assembly] = assembly;
}
foreach (Assembly assembly in assemblyHash.Keys) {
typesInfo.LoadTypes(assembly);
}
_xpandControllersManager.CollectControllers(IsTypeFromModule);
}
示例2: GetApplication
private XafApplication GetApplication(string executableName, ITypesInfo typesInfo) {
string assemblyPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
try {
ReflectionHelper.AddResolvePath(assemblyPath);
var assembly = ReflectionHelper.GetAssembly(Path.GetFileNameWithoutExtension(executableName), assemblyPath);
var assemblyInfo = typesInfo.FindAssemblyInfo(assembly);
typesInfo.LoadTypes(assembly);
var findTypeInfo = typesInfo.FindTypeInfo(typeof(XafApplication));
var findTypeDescendants = ReflectionHelper.FindTypeDescendants(assemblyInfo, findTypeInfo, false);
return Enumerator.GetFirst(findTypeDescendants).CreateInstance(new object[0]) as XafApplication;
} finally {
ReflectionHelper.RemoveResolvePath(assemblyPath);
}
}