public override bool Equals(object obj) { IMVDTypeDescriptor other = obj as IMVDTypeDescriptor; if (obj == null) { return(false); } return(string.Compare(this.m_name, other.Name) == 0 && string.Compare(this.m_nameSpace, other.NameSpace) == 0); }
public List <IMVDTypeDescriptor> GetTypeDescriptors(string assemblyPath) { List <IMVDTypeDescriptor> tdList = new List <IMVDTypeDescriptor>(); if (string.IsNullOrWhiteSpace(assemblyPath)) { return(tdList); } Assembly assem = Assembly.LoadFrom(assemblyPath); if (assem == null) { return(tdList); } foreach (Type t in assem.GetTypes()) { try { if (t.IsAbstract || t.GetInterface("IMVDTypeDescriptor") == null) { continue; } IMVDTypeDescriptor td = Activator.CreateInstance(t) as IMVDTypeDescriptor; if (td != null) { tdList.Add(td); } } catch //(Exception ex) { //todo: output to ErrorList window } } tdList.Sort((x, y) => string.Compare(x.FullName, y.FullName)); return(tdList); }