B2017-232 handle sorting tree node names that contain more than one period

This commit is contained in:
John Jenko 2017-10-10 18:42:03 +00:00
parent 916f834a66
commit 17b9ec24b2

View File

@ -397,9 +397,11 @@ namespace Volian.Controls.Library
Match match2 = _RegExGetNumber.Match(value2);
if (match1.Success && !match1.Value.Contains("/") && match2.Success && !match2.Value.Contains("/")) // Compare the numeric value
{
double dbl1 = double.Parse(match1.ToString());
double dbl2 = double.Parse(match2.ToString());
return dbl1 > dbl2;
double dbl1;
double dbl2;
//B2017-232 changed from Parse to TryParse. AEP had figure title that had a number containing two periods which caused Parse to error
if (double.TryParse(match1.ToString(), out dbl1) && double.TryParse(match2.ToString(), out dbl2))
return dbl1 > dbl2;
}
return String.Compare(value1, value2, true) > 0;
}