Rect.ToString() behavior doesn't match documentation - by Bradley Grainger

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


2
0
Sign in
to vote
ID 716279 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 1/2/2012 11:57:30 AM
Access Restriction Public

Description

According to the documentation (http://msdn.microsoft.com/en-us/library/ms521832.aspx), System.Windows.Rect.ToString() returns a string in the form "X,Y,Width,Height". This seems like a perfect match for the Parse method (http://msdn.microsoft.com/en-us/library/system.windows.rect.parse.aspx) which accepts a string in that same format.

However, ToString() follows the .NET conventions of returning locale-sensitive results and requires that the ToString(IFormatProvider) overload be called to return culture-invariant output. In most European locales (e.g., "de" or "fr"), new Rect(1.5, 2, 3.5, 4).ToString() will return "1,5;2;3,5;4". If this string is passed to Parse, it will throw a FormatException.

Since it makes sense for Rect.ToString() to follow the overall .NET convention (of producing locale-sensitive output unless specifically overridden), the documentation should be corrected to make it clear that the returned string is locale-sensitive.
Sign in to post a comment.
Posted by Dwayne [MSFT] on 1/3/2012 at 10:48 AM
You are correct, the Rect.ToString method formats according to the current locale. However, the user education team reports that this page is very rarely viewed and so updating the documentation is low priority. In addition, there are user comments clarifying this behavior. Resolving as Won't Fix.
Posted by MS-Moderator10 [Feedback Moderator] on 1/2/2012 at 5:45 PM
Thank you for submitting feedback on Visual Studio 2010 and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by MS-Moderator01 on 1/2/2012 at 12:40 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)