internal TypeLibrary LoadLibrary(ITypeLib typeLib)
        {
            var name    = ComHelper.GetTypeLibName(typeLib);
            var library = LoadedLibraries.FirstOrDefault(l => l.Name == name);

            if (library == null)
            {
                library = new TypeLibrary(typeLib, this);
                _libraries.Add(library);
            }
            return(library);
        }
Esempio n. 2
0
        private TypeLibrary(string filePath, ComTypes.ITypeLib typeLib, TypeLibraries typeLibraries)
        {
            FilePath       = filePath;
            Name           = ComHelper.GetTypeLibName(typeLib);
            _typeLib       = typeLib;
            _typeLibraries = typeLibraries;

            var libAttr = ComHelper.GetTypeLibAttr(typeLib);

            Guid   = libAttr.guid;
            Hidden = libAttr.wLibFlags.HasFlag(ComTypes.LIBFLAGS.LIBFLAG_FHIDDEN) ||
                     libAttr.wLibFlags.HasFlag(ComTypes.LIBFLAGS.LIBFLAG_FRESTRICTED);
            Lcid         = libAttr.lcid;
            MajorVersion = libAttr.wMajorVerNum;
            MinorVersion = libAttr.wMinorVerNum;

            CreateTypeInformation();
            BuildMembers();
        }