Class ProjectModuleKinds
Decides what a module of a project is, and reads its text, the way every side of the platform does: a client that shows a project's modules, such as an IDE's add-in, gets the answer the environment host and the language server get.
public static class ProjectModuleKinds
- Inheritance
-
ProjectModuleKinds
- Inherited Members
Remarks
A module whose entry in the project names a document (Super) is a document module, whatever its text and its file name. The code
of an RDForms form (a RDFormsModuleExtension file) is a class module: its text has no VERSION header, and its file's extension is what
says it. Any other module is a class module when its text has a VERSION header, and a standard module otherwise.
Fields
RDFormsLibraryName
The name of the library that describes RDForms' forms and controls: RDForms.
public const string RDFormsLibraryName = "RDForms"
Field Value
Remarks
A project that has the code of an RDForms form (IsRDFormsModule(string?)) references it without its project file listing it, as a VB6 project
references VB (SupportedLanguage.ImplicitReferencesOf).
RDFormsModuleExtension
The extension of the file that holds the code of an RDForms form: .rdform.
public const string RDFormsModuleExtension = ".rdform"
Field Value
Remarks
An RDForms form is two files of one base name, in one folder: its code, a class module whose text is its Attribute VB_* lines and then its
declarations and procedures, with no VERSION header and no designer block; and its RDForms document, a .xaml beside it, which holds
its controls.
Methods
IsRDFormsModule(string?)
Whether the file at path is the code of an RDForms form: its extension is RDFormsModuleExtension, whatever its case.
public static bool IsRDFormsModule(string? path)
Parameters
Returns
Of(RDCoreModule, string?)
The kind of module, from its entry in the project (its document, and its file's extension) and its text.
public static ProjectModuleKind Of(RDCoreModule module, string? source)
Parameters
moduleRDCoreModuleThe module's entry in the project.
sourcestringThe module's text (ReadText(byte[])), or null when it could not be read.
Returns
Of(DocClassType?, string?, string?)
The kind of a module that the project says is the code of super, or of no document when it is null, in the file
at path.
public static ProjectModuleKind Of(DocClassType? super, string? source, string? path)
Parameters
superDocClassType?What the project says the module's document is (Super).
sourcestringThe module's text (ReadText(byte[])), or null when it could not be read.
pathstringThe module's file path or relative URI, or null for a module that has no file.
Returns
ReadText(byte[])
The text of a module's file, decoded as the platform decodes it: UTF-8, unless a byte order mark says another Unicode encoding, and without that mark.
public static string ReadText(byte[] bytes)
Parameters
bytesbyte[]The file's bytes.
Returns
Remarks
This is what ReadAllText(string) gives, the way the environment host and the language server read a module, so a client reads the
same VERSION header they do: a header after a UTF-8 or UTF-16 mark is found, and the mark is no part of the text.