Click or drag to resize
Ranorex

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
Syntax
public static bool TryParse(
	string s,
	out Distance d
)

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
ExceptionCondition
ArgumentNullExceptionIf the given string is null.
ArgumentExceptionIf the given string is not a numeric type (int or double).
ArgumentOutOfRangeExceptionIf the given string is a negative number.
See Also