private void InitialiseSettings() { // retrieve the settings from the repository _settings = SettingRepository.All(); if (_settings == default(IList <Setting>) || !_settings.Any()) { return; } // loop through all the settings, and switch on the name to determine the values to set foreach (var setting in _settings) { switch (setting.Name) { case nameof(Minimize): _minimize = setting.BooleanValue; break; case nameof(AbortedEqualsFailed): _abortedEqualsFailed = setting.BooleanValue; break; } } }