ConvertToUserSettings method

void ConvertToUserSettings(
  1. List<UserSettingName> requestedSettings,
  2. GetUserSettingsResponse response
)
Convert OutlookUser to GetUserSettings response. The requested settings. The response.

Implementation

void ConvertToUserSettings(List<UserSettingName> requestedSettings,
    GetUserSettingsResponse response) {
  // In English: collect converters that are contained in the requested settings.

  var converterQuery = _converterDictionary.Member!.entries
      .where((converter) => requestedSettings.contains(converter.key));
//            var converterQuery = from converter in _converterDictionary.Member
//                                 where requestedSettings.Contains(converter.Key)
//                                 select converter;

  for (MapEntry<UserSettingName, Func<OutlookUser, String?>> kv
      in converterQuery) {
    String? value = kv.value(this);
    if (!StringUtils.IsNullOrEmpty(value)) {
      response.Settings[kv.key] = value;
    }
  }
}