/// <summary> /// 获取依赖的所有插件的元数据集合 /// </summary> /// <returns></returns> private DependentBundle[] GetDependentBundles() { // 检查集合是否已存在 if (dependentBundles != null) { return(dependentBundles.ToArray()); } // 获取运行时元数据 XRuntime xRuntime = manifest.Runtime; if (xRuntime == null) { return(null); } // 获取所有依赖插件元数据 XDependency[] xDependencies = xRuntime.Dependencies; if (xDependencies == null || xDependencies.Length == 0) { return(null); } foreach (XDependency xDependency in xDependencies) { if (dependentBundles == null) { dependentBundles = new List <DependentBundle>(); } DependentBundle entry = new DependentBundle(xDependency); dependentBundles.Add(entry); } return(dependentBundles.ToArray()); }
/// <summary> /// 获取依赖的所有程序集的元数据集合 /// </summary> /// <returns></returns> private AssemblyEntry[] GetAssemblyEntries() { // 检查集合是否已存在 if (assemblyEntries != null) { return(assemblyEntries.ToArray()); } // 获取运行时元数据 XRuntime xRuntime = manifest.Runtime; if (xRuntime == null) { return(null); } // 获取所有依赖程序集元数据 XAssembly[] xAssemblies = xRuntime.Assemblies; if (xAssemblies == null || xAssemblies.Length == 0) { return(null); } foreach (XAssembly xAssembly in xAssemblies) { if (assemblyEntries == null) { assemblyEntries = new List <AssemblyEntry>(); } AssemblyEntry entry = new AssemblyEntry(xAssembly); assemblyEntries.Add(entry); } return(assemblyEntries.ToArray()); }