Table of Contents

Class ProjectModuleKinds

Namespace
RDCore.SDK.Workspace
Assembly
RDCore.SDK.Protocols.dll

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

string

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

string

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

path string

The file's path or relative URI, or null for a module that has no file.

Returns

bool

false when path is null.

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

module RDCoreModule

The module's entry in the project.

source string

The module's text (ReadText(byte[])), or null when it could not be read.

Returns

ProjectModuleKind

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

super DocClassType?

What the project says the module's document is (Super).

source string

The module's text (ReadText(byte[])), or null when it could not be read.

path string

The module's file path or relative URI, or null for a module that has no file.

Returns

ProjectModuleKind

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

bytes byte[]

The file's bytes.

Returns

string

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.