 | DistanceTryParse Method |
Converts a string representation of a distance to its distance equivalent. The return value indicates whether the conversion
succeeded.
Namespace:
Ranorex.Core
Assembly:
Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntaxpublic static bool TryParse(
string s,
out Distance d
)
Public Shared Function TryParse (
s As String,
<OutAttribute> ByRef d As Distance
) As Boolean
Parameters
- s
- Type: SystemString
A string containing the distance to convert. - d
- Type: Ranorex.CoreDistance
The parsed distance
Return Value
Type:
Boolean
When this method returns, 'd' contains the distance equivalent if the conversion succeeded, or
Distance(0) if the conversion failed. The conversion fails if parameter 's' is null,
Empty,
it has a invalid format or the given string represents a negative number.
Exceptions| Exception | Condition |
|---|
| ArgumentNullException | If the given string is null. |
| ArgumentException | If the given string is not a numeric type (int or double). |
| ArgumentOutOfRangeException | If the given string is a negative number. |
See Also