+ /// CapyEventReporter.EmitEvent(EventLevel.Error, "Could not find the description for {0}.", args: new[] { enumeration });
+ ///
///
+ /// public int main(string[] args)
+ /// {
+ /// // Set up SettingsHelper with custom accessor and detector methods
+ /// Func<string, object> accessor = (key) =>
+ /// {
+ /// Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+ /// return config.AppSettings.Settings[key].Value;
+ /// };
+ ///
+ /// Func<string, bool> detector = (key) =>
+ /// {
+ /// Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+ /// return config.AppSettings.Settings.AllKeys.Contains(key);
+ /// };
+ ///
+ /// SettingsHelper.SetAccessorMethod(accessor);
+ /// SettingsHelper.SetDetectorMethod(detector);
+ ///
+ /// // Use the helper to retrieve and set settings
+ /// SettingsHelper.SetApplicationSetting<int>("MySettingKey", 42);
+ /// int newSetting = SettingsHelper.GetApplicationSetting<int>("MySettingKey");
+ /// Console.WriteLine("New setting: {0}", newSetting);
+ ///
+ /// int mySetting = SettingsHelper.GetApplicationSetting<int>("MySettingKey");
+ /// Console.WriteLine("Retrieved setting: {0}", mySetting);
+ /// }
+ ///
+ /// [TODO: Add links to each specific version page]
accessor | +Private delegate function that retrieves a setting with the given key . Returns the setting as an uncast Object. |
detector | +Private delegate function that detects if a setting with a given key exists. Returns true if the setting exists, false if not. |
ArgumentNullException | +Thrown when one or more required arguments are null. |
ArgumentNullException | +Thrown when one or more required arguments are null. |
GetApplicationSetting(T) | +Retrieves a setting with the given key . Returns the setting as an uncast T. |
SetAccessorMethod | +Sets the function used to retrieve application settings. |
SetDetectorMethod | +Sets the function used to detect if an application setting with a given key exists. |
CapyKit | +|
CapyKit.Attributes | +|
CapyKit.Extensions | +|
CapyKit.Helpers | +
Inheritance | Object → SettingsHelper |
SettingsHelper | +
GetApplicationSetting(T) | +Retrieves a setting with the given key . Returns the setting as an uncast T. |
SetAccessorMethod | +Sets the function used to retrieve application settings. |
SetDetectorMethod | +Sets the function used to detect if an application setting with a given key exists. |
accessor | +Private delegate function that retrieves a setting with the given key . Returns the setting as an uncast Object. |
detector | +Private delegate function that detects if a setting with a given key exists. Returns true if the setting exists, false if not. |
[TODO: Add change items here]