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
Kind
What the change changes.
[JsonProperty("kind")]
[JsonConverter(typeof(StringEnumConverter))]
public ProjectChangeKind Kind { get; init; }
Property Value
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
Methods
AddReference(string)
The project is to reference a library.
public static ProjectChange AddReference(string library)
Parameters
librarystringThe name of the library:
Excel.
Returns
ApplyTo(ProjectFile, Uri, ILibrarySource)
The project, with the change made.
public ProjectFile? ApplyTo(ProjectFile project, Uri module, ILibrarySource libraries)
Parameters
projectProjectFileThe project.
moduleUriThe URI of the document the finding is in.
librariesILibrarySourceThe 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
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
documentClassDocClassTypeThe class of the document.