ConvertToValue static method

List ConvertToValue(
  1. MapiPropertyType? mapiPropType,
  2. Iterable<String?> strings
)
Converts the String list to array. Type of the MAPI property. Strings.

Implementation

static List ConvertToValue(
  MapiPropertyType? mapiPropType,
  Iterable<String?> strings,
) {
  EwsUtilities.ValidateParam(strings, "strings");

  misc.MapiTypeConverterMapEntry typeConverter =
      MapiTypeConverterMap.Member![mapiPropType!]!;

  final values = <Object?>[
    for (String? stringValue in strings)
      typeConverter.ConvertToValueOrDefault(stringValue),
  ];

  return typeConverter.CreateArray(values);
}