TryParse<T> static method

bool TryParse<T>(
  1. String? value,
  2. OutParam<T> resultOutParam
)
Tries to parses the specified value to the specified type. The value to parse. The value cast to the specified type, if TryParse succeeds. Otherwise, the value of result is indeterminate.

Implementation

static bool TryParse<T>(String? value, OutParam<T> resultOutParam) {
  try {
    resultOutParam.param = EwsUtilities.Parse<T>(value);

    return true;
  }
  //// Catch all exceptions here, we're not interested in the reason why TryParse failed.
  catch (Exception) {
    // todo("check here")
    resultOutParam.param = null;

    return false;
  }
}