ConvertToUserSettings method

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

Implementation

void ConvertToUserSettings(List<UserSettingName> requestedSettings,
    GetUserSettingsResponse response) {
  if (this.ConverterDictionary != null) {
    // In English: collect converters that are contained in the requested settings.
    var converterQuery = this
        .ConverterDictionary!
        .entries
        .where((converter) => requestedSettings.contains(converter.key));
//                var converterQuery = from converter in this.ConverterDictionary
//                                     where requestedSettings.Contains(converter.Key)
//                                     select converter;

    for (MapEntry<UserSettingName, Func<OutlookProtocol, Object?>> kv
        in converterQuery) {
      Object? value = kv.value(this);
      if (value != null) {
        response.Settings[kv.key] = value;
      }
    }
  }
}