private IList <PluginRefrenceInfo> GetAllPluginRefrenceInfo() { IList <PluginRefrenceInfo> result = new List <PluginRefrenceInfo>(); PluginRefrenceInfo oldItem, newItem; foreach (var srcPluginDirectory in new DirectoryInfo(PluginDirectory).GetDirectories()) { foreach (var srcPluginReferencePath in srcPluginDirectory.GetFiles("*.*")) { newItem = new PluginRefrenceInfo(srcPluginReferencePath.FullName); oldItem = result.FirstOrDefault(t => t.Equals(newItem)); if (oldItem == null) { result.Add(newItem); } else { if (oldItem.CompareTo(newItem) <= 0) { result.Remove(oldItem); result.Add(newItem); } } } } return(result); }
public override bool Equals(object obj) { PluginRefrenceInfo obj2 = obj as PluginRefrenceInfo; return(name.Equals(obj2.name, StringComparison.OrdinalIgnoreCase) && publicKeyToken.Equals(obj2.publicKeyToken)); }