Table of Contents

Class ProjectChange

Namespace
RDCore.SDK.Extensibility.Diagnostics
Assembly
RDCore.SDK.dll

One change of the project, which a ProjectFix makes: a library the project is to reference, or what it is to say of the module a finding is in.

public sealed record ProjectChange : IEquatable<ProjectChange>
Inheritance
ProjectChange
Implements
Inherited Members

Properties

DocumentClass

The class of the host document the module is the code of (SetDocumentClass); null for another change.

[JsonProperty("documentClass", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(StringEnumConverter))]
public DocClassType? DocumentClass { get; init; }

Property Value

DocClassType?

Kind

What the change changes.

[JsonProperty("kind")]
[JsonConverter(typeof(StringEnumConverter))]
public ProjectChangeKind Kind { get; init; }

Property Value

ProjectChangeKind

Library

The name of the library the project is to reference (AddReference), as source code qualifies its types with it: Excel. null for another change.

[JsonProperty("library", NullValueHandling = NullValueHandling.Ignore)]
public string? Library { get; init; }

Property Value

string

Methods

AddReference(string)

The project is to reference a library.

public static ProjectChange AddReference(string library)

Parameters

library string

The name of the library: Excel.

Returns

ProjectChange

ApplyTo(ProjectFile, Uri, ILibrarySource)

The project, with the change made.

public ProjectFile? ApplyTo(ProjectFile project, Uri module, ILibrarySource libraries)

Parameters

project ProjectFile

The project.

module Uri

The URI of the document the finding is in.

libraries ILibrarySource

The descriptions of the libraries a project can reference.

Returns

ProjectFile

The changed project, which is the project itself when it says so already; null when the change cannot be made.

Remarks

A library is referenced after every library the project references already: a reference that occurs earlier in the list has the higher precedence (MS-VBAL §4.1), so a name that one of them declares too keeps meaning theirs. The reference is to the type library the library's description was made from, by its identifier and version (Of(LibraryDescription)). A project that references a library of the name already is not changed. When no library description has the name, the change cannot be made.

The module is the one the project lists at the path of the document, relative to the project's folder (Uri), whichever separators the project file writes it with. A module the project does not list cannot be changed.

RemoveModule()

The module the finding is in is to be removed from the project.

public static ProjectChange RemoveModule()

Returns

ProjectChange

SetDocumentClass(DocClassType)

The module the finding is in is to be the code of a host's document of a class.

public static ProjectChange SetDocumentClass(DocClassType documentClass)

Parameters

documentClass DocClassType

The class of the document.

Returns

ProjectChange