private ComTypeLibrary GetComTypeLibrary(ITypeLib typeLib) { Guid typeLibGuid = typeLib.GetGuid(); Version typeLibVersion = typeLib.GetVersion(); ComTypeLibrary comTypeLibrary = _typeLibraries.Where( x => x.Guid.Equals(typeLibGuid)).Where( x => x.Version.Equals(typeLibVersion) ).FirstOrDefault(); if (comTypeLibrary == null) { comTypeLibrary = new ComTypeLibrary(typeLib); _typeLibraries.Add(comTypeLibrary); _typeLibraries.Sort(delegate(ComTypeLibrary a, ComTypeLibrary b) { return(a.Name.CompareTo(b.Name)); }); } return(comTypeLibrary); }
private ComTypeLibrary GetComTypeLibrary(ITypeLib typeLib) { Guid typeLibGuid = typeLib.GetGuid(); Version typeLibVersion = typeLib.GetVersion(); ComTypeLibrary comTypeLibrary = _typeLibraries.Where( x => x.Guid.Equals(typeLibGuid)).Where( x => x.Version.Equals(typeLibVersion) ).FirstOrDefault(); if (comTypeLibrary == null) { comTypeLibrary = new ComTypeLibrary(typeLib); _typeLibraries.Add(comTypeLibrary); _typeLibraries.Sort(delegate(ComTypeLibrary a, ComTypeLibrary b) { return a.Name.CompareTo(b.Name); }); } return comTypeLibrary; }