public override bool IsValid( object value )
{
try
{
string routeText = ( value as string );
Route testRoute = new Route( routeText, null );
return true;
}
catch ( Exception ex )
{
string[] exceptionLines = ex.Message.Split( new string[] { "\r" }, StringSplitOptions.RemoveEmptyEntries );
// just get first line of message, and escape any braces that might be in it
ErrorMessage = exceptionLines[0].Replace( "{", "{" ).Replace( "}", "}" );
return false;
}
}