Table of Contents

Class ReferencedLibraries

Namespace
RDCore.SDK.Runtime.Libraries
Assembly
RDCore.SDK.dll

The libraries a project references, loaded: those that were asked for and those they depend on, and the ones that could not be.

public sealed class ReferencedLibraries
Inheritance
ReferencedLibraries
Inherited Members

Remarks

A library is loaded as a whole or not at all. One that cannot be found or read is a problem, and so is every library that depends on it: what a library declares is typed with what it depends on, and a description whose types name nothing is not one a project can be checked against.

Libraries that depend on one another are rejected, not resolved: each of the libraries on the cycle is a problem, with the cycle in it. There is no order to load them in, and the platform does not make one up. (The types a single library declares may name one another freely; that is not a reference between libraries.)

Properties

Libraries

The libraries that were loaded, each after the libraries it depends on.

public ImmutableArray<LibraryDescription> Libraries { get; }

Property Value

ImmutableArray<LibraryDescription>

None

No libraries, and no problems.

public static ReferencedLibraries None { get; }

Property Value

ReferencedLibraries

Priorities

The reference precedence of each library that was loaded, by its name: of two libraries that declare a name, the one with the lower number is the one the name means (LibraryPriority).

public ImmutableDictionary<string, int> Priorities { get; }

Property Value

ImmutableDictionary<string, int>

Remarks

A reference that occurs earlier in the list of a project's references has the higher reference precedence (MS-VBAL §4.1), and the references are in the order of the project file (RD-VBAL §2.3.1.2): the first library the project references is 1, the next 2, and so on, a reference to a provided library, or a second one to the same library, not counted, and a reference that fails to load keeping its number. A library that is loaded only because another depends on it comes after every library the project references, in the order it was loaded. The standard library, which the platform provides and which comes before every reference, is not in it.

Problems

The libraries that could not be loaded.

public ImmutableArray<LibraryProblem> Problems { get; }

Property Value

ImmutableArray<LibraryProblem>

Methods

Load(ILibrarySource, IEnumerable<LibraryIdentity>, IReadOnlyCollection<string>)

Loads the libraries a project references.

public static ReferencedLibraries Load(ILibrarySource source, IEnumerable<LibraryIdentity> references, IReadOnlyCollection<string> provided)

Parameters

source ILibrarySource

Where the descriptions are.

references IEnumerable<LibraryIdentity>

The libraries the project references, in the order of its references. A second reference to a name is left out, and is a problem (DuplicateName) unless it means the library of the first: it is the same identity, or the source finds the same description for both. The standard library (VBA) is the platform's own, and is not asked of the source.

provided IReadOnlyCollection<string>

The names of the libraries the platform provides itself.

Returns

ReferencedLibraries

Remarks

A library is found by its identity (TryGet(LibraryIdentity, out LibraryDescription?)): the library of its name, or the description of the type library it gives. A session has one library of a name: a dependency whose name the project references is the library the project references, whatever identity the library that depends on it states (RD-VBAL §2.3.1.2).