Class LibraryDescription
What a referenced library declares, as a file: the types a project that references the library can name, and the members of each.
public sealed record LibraryDescription : IEquatable<LibraryDescription>
- Inheritance
-
LibraryDescription
- Implements
- Inherited Members
Remarks
A library is known by its Name: a project references Scripting, and source code qualifies its types with that name, as if the library
were VBA code. Origin is the type library it was described from, with the identifier and version that the registry of that machine
gives it. When libraries of one name are several (DAO), a reference or a dependency that gives an identifier and a version
finds the description whose origin they are (LibraryIdentity); one that gives a name alone finds the library of the name.
The description is a file because what a library declares is needed where the library is not: a workspace is analyzed on a machine that does not have Excel, and the symbols it needs are those of a description that ships with the platform. It is written by a tool that reads the library where it is, and by no one else; it is plain JSON (LibraryJson) so that a change to one reads as a change in review.
What it holds is what a VBA project can name: enumerations, and classes with their members and events. A type is named in a description the way VBA source names it (Type).
Properties
Classes
The classes the library declares.
public ImmutableArray<ClassDescription> Classes { get; init; }
Property Value
DependsOn
The libraries whose types this one's members are declared as, each by its name and, when the description says, the identifier and version of the type library it was built against. They are loaded with it, whether or not a project references them: a project that references Excel can use what Excel returns. A dependency whose name a project references is the library the project references (RD-VBAL §2.3.1.2).
public ImmutableArray<LibraryIdentity> DependsOn { get; init; }
Property Value
Description
What the library says it is, in a sentence.
public string? Description { get; init; }
Property Value
Enums
The enumerations the library declares.
public ImmutableArray<EnumDescription> Enums { get; init; }
Property Value
FormatVersion
The version of the format of the file, which a reader that does not know it refuses rather than misreads (CurrentFormatVersion).
public int FormatVersion { get; init; }
Property Value
Modules
The modules the library declares: standard modules, whose members are procedures called on no object, and names of a project that references the
library, as the standard library's are (LoadPicture of the OLE Automation library's StdFunctions). A module is not a type.
public ImmutableArray<ModuleDescription> Modules { get; init; }
Property Value
Remarks
Stated from format version 3 of the file (CurrentFormatVersion).
Name
The name of the library: what a project references it by, and what qualifies the types it declares (Excel.Worksheet).
public string Name { get; init; }
Property Value
Origin
Where the description was made.
public LibraryOrigin? Origin { get; init; }
Property Value
Methods
KeepingDesignTimeOnly(LibraryDescription?, out IReadOnlyList<string>)
This description, with what replaced states that a type library cannot: each member that is design-time only there
(IsDesignTimeOnly) is design-time only here, matched by its class's name, its name and its kind, ignoring case.
public LibraryDescription KeepingDesignTimeOnly(LibraryDescription? replaced, out IReadOnlyList<string> lost)
Parameters
replacedLibraryDescriptionThe description this one replaces; null for none, which leaves this one as it is.
lostIReadOnlyList<string>The members that are design-time only in
replacedand that this description does not declare, asClass.Member, sorted; empty when none.
Returns
- LibraryDescription
The description, with the members that are design-time only in
replacedstated as such.
Remarks
Call it on a description exported from a type library that replaces the file of an earlier export. The type library declares a property that is design-time only the same way as a read-only one, so the earlier file is the only place the fact is stated.