Class RuntimeEnvironmentProfile
The default IRuntimeEnvironmentProfile implementation.
public sealed record RuntimeEnvironmentProfile : IRuntimeEnvironmentProfile, IEquatable<RuntimeEnvironmentProfile>
- Inheritance
-
RuntimeEnvironmentProfile
- Implements
- Inherited Members
Constructors
RuntimeEnvironmentProfile(bool, int, int, bool, OptionCompare, VBErlLineNumbering, bool, SupportedLanguage?, bool, bool, RegionalSettings?)
The default IRuntimeEnvironmentProfile implementation.
public RuntimeEnvironmentProfile(bool Is64Bit, int Lcid, int AnsiCodePage, bool SupportsOptionCompareDatabase, OptionCompare DatabaseCompare = OptionCompare.Text, VBErlLineNumbering ErlLineNumbering = VBErlLineNumbering.DocumentLine, bool AllowDllImports = true, SupportedLanguage? SourceLanguage = null, bool AllowAutomation = true, bool LegacyRegistrySettings = false, RegionalSettings? RegionalSettings = null)
Parameters
Is64BitboolWhether the environment is 64-bit.
LcidintThe environment LCID;
0for the invariant locale.AnsiCodePageintThe ANSI code page of the text of a file and of
Chr/Asc.SupportsOptionCompareDatabaseboolWhether
Option Compare Databaseis supported.DatabaseCompareOptionCompareThe comparison mode
Option Compare Databasestands for;Textunless said otherwise.ErlLineNumberingVBErlLineNumberingWhat
Erlcounts as a line; the document line unless said otherwise.AllowDllImportsboolWhether a
Declare'd library import may be called;trueunless said otherwise.SourceLanguageSupportedLanguageThe language the code is written in; RD-VBA unless said otherwise.
AllowAutomationboolWhether a program may create and call the objects of a referenced library, a host application among them;
trueunless said otherwise.LegacyRegistrySettingsboolWhether the legacy settings members use the Windows Registry rather than the workspace application settings;
falseunless said otherwise.RegionalSettingsRegionalSettingsThe regional settings a number or a date is written by as a string, and a string read by as one; en-US (Default) unless said otherwise.
Properties
AllowAutomation
Whether a program may create and call the objects of a referenced library, a host application among them; true unless said otherwise.
public bool AllowAutomation { get; init; }
Property Value
AllowDllImports
Whether a Declare'd library import may be called; true unless said otherwise.
public bool AllowDllImports { get; init; }
Property Value
AnsiCodePage
The ANSI code page of the text of a file and of Chr / Asc.
public int AnsiCodePage { get; init; }
Property Value
AnsiEncoding
The Encoding of AnsiCodePage: the one encoding the session's files and the standard library's character codes share, so that the two cannot disagree about what a byte is.
public Encoding AnsiEncoding { get; }
Property Value
Remarks
🚧 The provider supplies only the code pages .NET does not build in, so a code page it does build in (65001, 28591, 20127, 1200) is Latin-1 here, the same as one that does not exist. TODO.
Culture
The CultureInfo for Lcid — drives Option Compare Text,
Like, case conversion, and Format$ given a format.
public CultureInfo Culture { get; }
Property Value
Remarks
👉 Not how a value is Let-coerced to or from a String: a number or a date is written and read by Regional, which is the
platform's and not the culture's, so that what CStr writes, CDbl and CDate read back.
DatabaseCompare
The comparison mode Option Compare Database stands for; Text unless said otherwise.
public OptionCompare DatabaseCompare { get; init; }
Property Value
Default
A 64-bit, invariant-culture, Windows-1252, no-Option Compare Database profile for
design-time and tests.
public static IRuntimeEnvironmentProfile Default { get; }
Property Value
ErlLineNumbering
What Erl counts as a line; the document line unless said otherwise.
public VBErlLineNumbering ErlLineNumbering { get; init; }
Property Value
Is64Bit
Whether the environment is 64-bit.
public bool Is64Bit { get; init; }
Property Value
Language
The language the code is written in: what the environment is a dialect of, and so which symbols and statements exist at all.
public SupportedLanguage Language { get; }
Property Value
Remarks
👉 RD-VBA unless the workspace says otherwise. It is not derivable from the source, which is why it is a fact of the environment.
Lcid
The environment LCID; 0 for the invariant locale.
public int Lcid { get; init; }
Property Value
LegacyRegistrySettings
Whether the legacy settings members use the Windows Registry rather than the workspace application settings; false unless said otherwise.
public bool LegacyRegistrySettings { get; init; }
Property Value
Regional
🎯 The regional settings of Let-coercion to and from String (MS-VBAL §5.5.1.2.4): a number or a date is written by
them, and a String read by them as a number or a date. The decimal, digit grouping and currency symbols, the Short Date and Long Time
formats, and the window two-digit years are in; en-US unless the platform's configuration says otherwise.
public RegionalSettings Regional { get; }
Property Value
Remarks
One source for both directions, as MS-VBA's is the machine's regional settings: a value written as text reads back as the same value.
RegionalSettings
The regional settings a number or a date is written by as a string, and a string read by as one; en-US (Default) unless said otherwise.
public RegionalSettings? RegionalSettings { get; init; }
Property Value
SourceLanguage
The language the code is written in; RD-VBA unless said otherwise.
public SupportedLanguage? SourceLanguage { get; init; }
Property Value
SupportsOptionCompareDatabase
Whether Option Compare Database is supported.
public bool SupportsOptionCompareDatabase { get; init; }
Property Value
Methods
From(SdkEnvironmentOptions, SupportedLanguage?)
Builds a profile from bound appsettings.json options, for code written in language.
public static RuntimeEnvironmentProfile From(SdkEnvironmentOptions options, SupportedLanguage? language = null)
Parameters
optionsSdkEnvironmentOptionslanguageSupportedLanguage