Beispiel #1
0
    public MySettings(IConfigurationManager configurationManager)
    {
        _configurationManager = configurationManager;

        _MyFirstProperty = SettingsBuilder <long> .Create(nameof(MyFirstProperty), 1345L, null, configurationManager);

        _MyFirstProperty.Description = "This is a description";

        _MySecondProperty = SettingsBuilder <bool> .Create(nameof(MySecondProperty), default(bool), null, configurationManager);

        _MyThirdProperty = SettingsBuilder <string> .Create(nameof(MyThirdProperty), "Test", null, configurationManager);

        _MyThirdProperty.Description = "This is another description";

        _MyFourthProperty = SettingsBuilder <TimeSpan> .ParseAndCreate(nameof(MyFourthProperty), "02:00", typeof(TimeSpanConverter), configurationManager);

        _MyFifthProperty = SettingsBuilder <bool> .ParseAndCreate(nameof(MyFifthProperty), "Ja", typeof(JaNeeConverter), configurationManager);
    }