/// <summary> /// /// </summary> /// <param name="aname"></param> /// <returns></returns> public Assembly Resolve(AssemblyName aname) { if (Assemblys == null) { return(null); } return(Assemblys.FirstOrDefault(a => AssemblyNameComparer.Equals(aname, a.GetName(), IncludeVersion))); }
/// <summary> /// 查找 /// </summary> /// <param name="type"></param> /// <returns></returns> public static XmlMember Find(Type type) { if (!Assemblys.ContainsKey(type.Assembly)) { Load(type.Assembly); } return(HelpXml.Find(p => p.Name == type.FullName)); }
void CurrentDomain_AssemblyLoad(object sender, AssemblyLoadEventArgs args) { Assembly a = args.LoadedAssembly; if (!Assemblys.ContainsKey(a.FullName)) { AddAssembly(a); } }
private void AddAssembly(Assembly a) { if (a != null) { if (a.FullName.StartsWith("mscorlib") == false) { Assemblys.Add(a.FullName, a); } Type[] tl = a.GetTypes(); foreach (Type t in tl) { // 只添加 public 类型 if (t.IsPublic && !t.FullName.StartsWith("<PrivateImplementationDetails>")) { TypeManager.AddType(t); } } } }