TrySerializeEnum static method

bool TrySerializeEnum(
  1. Object enumValue,
  2. OutParam<String> resultOutParam
)
The enum value to be serialized

Implementation

static bool TrySerializeEnum(
    Object enumValue, OutParam<String> resultOutParam) {
//            Map<Object, String> enumToStringDict;
//            String strValue;
//            if (enumToSchemaDictionaries.Member.containsKey(enumValue.runtimeType))
////                enumToStringDict.TryGetValue(value, out strValue))
//            {
//              throw NotImplementedException("TrySerializeEnum($enumValue)");
////                return strValue;
//            }
//            else
//            {
  if (ewsEnumDictionaries.containsKey(enumValue.runtimeType)) {
    resultOutParam.param =
        ewsEnumDictionaries[enumValue.runtimeType]![enumValue];
    return true;
  } else if (serializedEnumDictionaries.contains(enumValue.runtimeType)) {
    resultOutParam.param = EnumToString.parse(enumValue);
    return true;
  } else {
    return false;
  }
//            }
}