Table of Contents

Class ModuleKinds

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

What kind of module a module of a project is: the one decision every side of the platform makes of it the same way - the environment host composing its session from the project file, and the language server composing the workspace it analyzes.

public static class ModuleKinds
Inheritance
ModuleKinds
Inherited Members

Remarks

A document module is the code of a host's document (MS-VBAL §4.2.1): Excel's worksheets and workbook, Word's documents, Access's forms and reports. Its export (a .doccls, or a .cls from the VBE) says nothing of what it is, so the project says it: a module whose entry has a Super is one, whatever its text and its file name, and nothing else is - no name and no event handler makes a module one. Any other module is a class module when its text has a VERSION header (IsClassModule(string?)), and a standard module otherwise.

RD-VBA hosts no document: a document module is analyzed - its code binds, the members of its host's class among its names - and never run. Code that is to handle a document's events holds the document in a WithEvents variable of the host's class, from an application the program automates.

Methods

DirectivesOf(ModuleType, ModuleDirectives)

The directives a module of the specified kind has, from those its text declares: a document module is not creatable and is extensible, whatever its text says - its export carries none of the attributes that would say so.

public static ModuleDirectives DirectivesOf(ModuleType type, ModuleDirectives declared)

Parameters

type ModuleType

The module's kind (Of(RDCoreModule?, string?)).

declared ModuleDirectives

The directives the module's text declares.

Returns

ModuleDirectives

Remarks

  • VB_Creatable = False: only the host makes its documents, and New Sheet1 is a compile error.
  • VB_Extensible = True: the module extends the host's class (MS-VBAL §4.2.1), whose members its code names.

RD-VBA hosts no document, so nothing makes the document an instance of the module: it has no default instance, whatever its text says (VB_PredeclaredId is false), and none of its procedures can run.

HostClassOf(DocClassType)

The class of a library whose object a document of super is, whose members the code of its module names (Me.Range in a worksheet's); null for a document of a host RD-VBA does not know (Unknown).

public static DocumentHostClass? HostClassOf(DocClassType super)

Parameters

super DocClassType

What the project says the module's document is.

Returns

DocumentHostClass

IsClass(ModuleType)

Whether a module of this kind is a class module: its members are of each object of it, and Me is one of them. A document module is.

public static bool IsClass(this ModuleType type)

Parameters

type ModuleType

Returns

bool

Of(RDCoreModule?, string?)

The kind of a module of a project.

public static ModuleType Of(RDCoreModule? module, string? source)

Parameters

module RDCoreModule

The module's entry in the project, or null when the project does not list it (a shell's program).

source string

The module's text, or null when it could not be read.

Returns

ModuleType

Of(DocClassType?, string?)

The kind of a module that the project says is the document of super, or of no host when it is null.

public static ModuleType Of(DocClassType? super, string? source)

Parameters

super DocClassType?

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

source string

The module's text, or null when it could not be read.

Returns

ModuleType