2.4 KiB
2.4 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-17T16:11:20.599916+00:00 | zai-org/GLM-5-FP8 | 1 | c85bf33b30f4fe33 |
Config
Purpose
This module provides centralized access to a custom application configuration file, abstracting away the details of System.Configuration. It exists to allow the application to read settings from a non-default config file path defined by DataProConstants.CustomConfigPath, enabling configuration separation from the main executable.
Public Interface
DataProConfig (static class)
static Configuration AltConfig { get; }— Returns theConfigurationobject mapped to the custom config file. Useful for advanced configuration operations not covered by helper methods.static string GetAppSetting(string key)— Retrieves an application setting value by key from the<appSettings>section. ReturnsString.Emptyif the key is not found.static object GetSection(string sectionName)— Retrieves a named configuration section from the config file. Used by plugin code to access custom sections.
Invariants
- The static constructor runs exactly once, before any member is accessed.
Configis initialized viaConfigurationManager.OpenMappedExeConfigurationwithConfigurationUserLevel.Noneand will never be null after static construction.GetAppSettingalways returns a non-null string (empty string if key missing).- The configuration file path is determined by
DataProConstants.CustomConfigPathand cannot be changed at runtime.
Dependencies
- Depends on:
System.Configuration,DataProConstants(specificallyDataProConstants.CustomConfigPath). - Depended on by: Unknown from source alone—likely consumed by plugin code and core application components requiring configuration access.
Gotchas
- If
DataProConstants.CustomConfigPathpoints to a non-existent or malformed config file, the static constructor will throw an exception, rendering the entire class unusable for the application lifetime. GetAppSettingperforms a linear search throughConfig.AppSettings.Settingsusing LINQ; performance may degrade with very large numbers of settings.- The third parameter
truepassed toOpenMappedExeConfigurationis undocumented in the source context—it appears to be a boolean for "preload" behavior, but its exact effect is unclear from source alone.