public int?GetAssemblyIndexByName(string assemblyName) { if (Asms == null || !Asms.Any()) { return(null); } foreach (var asm in Asms) { if (string.Equals(asm.AssemblyName, assemblyName)) { return(asm.IndexId); } } return(null); }
public Assembly GetAssemblyByIndex(int idx) { var owningAsmName = Asms.FirstOrDefault(x => x.IndexId == idx); if (owningAsmName == null) { return(null); } var owningAsm = AppDomain.CurrentDomain.GetAssemblies() .FirstOrDefault( x => string.Equals(x.GetName().FullName, owningAsmName.AssemblyName, StringComparison.OrdinalIgnoreCase)); return(owningAsm); }