public ComReferenceProjectItem(IProject project, TypeLibrary library) : base(project, ItemType.COMReference) { this.Include = library.Name; this.Guid = library.Guid; this.VersionMajor = library.VersionMajor; this.VersionMinor = library.VersionMinor; this.Lcid = library.Lcid; this.WrapperTool = library.WrapperTool; this.Isolated = library.Isolated; }
static TypeLibrary Create(RegistryKey typeLibKey) { string[] versions = typeLibKey.GetSubKeyNames(); if (versions.Length > 0) { TypeLibrary lib = new TypeLibrary(); // Use the last version lib.version = versions[versions.Length - 1]; RegistryKey versionKey = typeLibKey.OpenSubKey(lib.version); lib.description = (string)versionKey.GetValue(null); lib.path = GetTypeLibPath(versionKey, ref lib.lcid); lib.guid = System.IO.Path.GetFileName(typeLibKey.Name); return(lib); } return(null); }
static TypeLibrary Create(RegistryKey typeLibKey) { string[] versions = typeLibKey.GetSubKeyNames(); if (versions.Length > 0) { TypeLibrary lib = new TypeLibrary(); // Use the last version lib.version = versions[versions.Length - 1]; RegistryKey versionKey = typeLibKey.OpenSubKey(lib.version); lib.description = (string)versionKey.GetValue(null); lib.path = GetTypeLibPath(versionKey, ref lib.lcid); lib.guid = System.IO.Path.GetFileName(typeLibKey.Name); return lib; } return null; }