Skip to content

Commit 4a983a6

Browse files
Fix text in the ThreadExceptionDialog (dotnet#430)
Fixes dotnet#202 * replaced hardcoded text that represents a resource name with a get …property that reads this resource * replaced explicit \r\n strings in SR.RESX file for system.windows.forms.dll with newlines because resx reader escapes them and as a result we don't have new lines in the displayed text * for other assemblies in this repo, I created a tracking issue to fix SR.resx files: dotnet#429 * added a test for this dialog to `WinformsControlsTest`, @zsd4yr - please review, I tested this change by running the app, is there anything else to run Before: ![image](https://user-images.githubusercontent.com/15823268/52612877-6e9bce00-2e40-11e9-80a2-41efcf9b94ca.png) After: ![image](https://user-images.githubusercontent.com/15823268/52612888-765b7280-2e40-11e9-988f-9501c75af58f.png)
1 parent 66054e8 commit 4a983a6

File tree

22 files changed

+1258
-882
lines changed

22 files changed

+1258
-882
lines changed

Winforms.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
44
VisualStudioVersion = 15.0.28016.0
55
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinformsControlsTest", "src\System.Windows.Forms\tests\IntegrationTests\WinformsControlsTest\WinformsControlsTest.csproj", "{657472B8-FDA3-49DF-B8BE-0246046A4348}"
7+
EndProject
68
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms", "src\System.Windows.Forms\src\System.Windows.Forms.csproj", "{0D23A41B-2626-4703-9E4A-87C07F69B0B2}"
79
EndProject
810
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Ref", "src\System.Windows.Forms\ref\System.Windows.Forms.Ref.csproj", "{334C343B-9D39-498E-89D8-B6526028FD5C}"
911
EndProject
1012
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Tests", "src\System.Windows.Forms\tests\UnitTests\System.Windows.Forms.Tests.csproj", "{AB38E262-F206-4820-8F29-23C5F72A4A16}"
1113
EndProject
12-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinformsControlsTest", "src\System.Windows.Forms\tests\IntegrationTests\WinformsControlsTest\WinformsControlsTest.csproj", "{657472B8-FDA3-49DF-B8BE-0246046A4348}"
13-
EndProject
1414
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Private.Winforms", "pkg\Microsoft.Private.Winforms.csproj", "{F133342A-3040-4005-A2F0-7685AA7CB82D}"
1515
EndProject
1616
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Design.Editors.Ref", "src\System.Windows.Forms.Design.Editors\ref\System.Windows.Forms.Design.Editors.Ref.csproj", "{5A619DC4-854A-450E-8F9A-AC72D2F5B59A}"

src/System.Windows.Forms/src/Resources/SR.resx

Lines changed: 66 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,10 +2176,16 @@
21762176
<value>DataGridView Default Error Dialog</value>
21772177
</data>
21782178
<data name="DataGridView_ErrorMessageText_NoException" xml:space="preserve">
2179-
<value>Exception occurred in the DataGridView.\r\n\r\nTo replace this default dialog box, handle the DataError event.</value>
2179+
<value>Exception occurred in the DataGridView.
2180+
2181+
To replace this default dialog box, handle the DataError event.</value>
21802182
</data>
21812183
<data name="DataGridView_ErrorMessageText_WithException" xml:space="preserve">
2182-
<value>The following exception occurred in the DataGridView:\r\n\r\n{0}\r\n\r\nTo replace this default dialog please handle the DataError event.</value>
2184+
<value>The following exception occurred in the DataGridView:
2185+
2186+
{0}
2187+
2188+
To replace this default dialog please handle the DataError event.</value>
21832189
</data>
21842190
<data name="DataGridView_FirstDisplayedCellCannotBeAHeaderOrSharedCell" xml:space="preserve">
21852191
<value>First displayed cell cannot be set to a header or shared cell.</value>
@@ -3145,13 +3151,17 @@
31453151
<value>&amp;Continue</value>
31463152
</data>
31473153
<data name="ExDlgContinueErrorText" xml:space="preserve">
3148-
<value>Unhandled exception has occurred in a component in your application. If you click Continue, the application will ignore this error and attempt to continue.\r\n\r\n{0}.</value>
3154+
<value>Unhandled exception has occurred in a component in your application. If you click Continue, the application will ignore this error and attempt to continue.
3155+
3156+
{0}.</value>
31493157
</data>
31503158
<data name="ExDlgDetailsText" xml:space="preserve">
31513159
<value>Error Text</value>
31523160
</data>
31533161
<data name="ExDlgErrorText" xml:space="preserve">
3154-
<value>Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.\r\n\r\n{0}.</value>
3162+
<value>Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.
3163+
3164+
{0}.</value>
31553165
</data>
31563166
<data name="ExDlgHelp" xml:space="preserve">
31573167
<value>&amp;Help</value>
@@ -3160,31 +3170,45 @@
31603170
<value>Exception Text</value>
31613171
</data>
31623172
<data name="ExDlgMsgFooterNonSwitchable" xml:space="preserve">
3163-
<value>Application does not support Windows Forms just-in-time (JIT)\r\ndebugging. Contact the application author for more\r\ninformation.\r\n</value>
3173+
<value>Application does not support Windows Forms just-in-time (JIT)
3174+
debugging. Contact the application author for more
3175+
information.
3176+
</value>
31643177
</data>
31653178
<data name="ExDlgMsgFooterSwitchable" xml:space="preserve">
31663179
<value />
31673180
</data>
31683181
<data name="ExDlgMsgHeaderNonSwitchable" xml:space="preserve">
3169-
<value>Application does not support just-in-time (JIT)\r\ndebugging. See the end of this message for details.\r\n</value>
3182+
<value>Application does not support just-in-time (JIT)
3183+
debugging. See the end of this message for details.
3184+
</value>
31703185
</data>
31713186
<data name="ExDlgMsgHeaderSwitchable" xml:space="preserve">
3172-
<value>See the end of this message for details on invoking \r\njust-in-time (JIT) debugging instead of this dialog box.\r\n</value>
3187+
<value>See the end of this message for details on invoking
3188+
just-in-time (JIT) debugging instead of this dialog box.
3189+
</value>
31733190
</data>
31743191
<data name="ExDlgMsgJITDebuggingSection" xml:space="preserve">
31753192
<value>JIT Debugging</value>
31763193
</data>
31773194
<data name="ExDlgMsgLoadedAssembliesEntry" xml:space="preserve">
3178-
<value>{0}\r\n Assembly Version: {1}\r\n Win32 Version: {2}\r\n CodeBase: {3}\r\n</value>
3195+
<value>{0}
3196+
Assembly Version: {1}
3197+
Win32 Version: {2}
3198+
CodeBase: {3}
3199+
</value>
31793200
</data>
31803201
<data name="ExDlgMsgLoadedAssembliesSection" xml:space="preserve">
31813202
<value>Loaded Assemblies</value>
31823203
</data>
31833204
<data name="ExDlgMsgSectionSeperator" xml:space="preserve">
3184-
<value>\r\n************** {0} **************\r\n</value>
3205+
<value>
3206+
************** {0} **************
3207+
</value>
31853208
</data>
31863209
<data name="ExDlgMsgSeperator" xml:space="preserve">
3187-
<value>----------------------------------------\r\n</value>
3210+
<value>----------------------------------------
3211+
</value>
31883212
</data>
31893213
<data name="ExDlgOk" xml:space="preserve">
31903214
<value>OK</value>
@@ -3193,10 +3217,18 @@
31933217
<value>&amp;Quit</value>
31943218
</data>
31953219
<data name="ExDlgSecurityContinueErrorText" xml:space="preserve">
3196-
<value>Application attempted to perform an operation not allowed by the security policy. To grant this application the required permission, contact your system administrator, or use the Microsoft .NET Framework Configuration tool.\r\n\r\nIf you click Continue, the application will ignore this error and attempt to continue.\r\n\r\n{1}.</value>
3220+
<value>Application attempted to perform an operation not allowed by the security policy. To grant this application the required permission, contact your system administrator, or use the Microsoft .NET Framework Configuration tool.
3221+
3222+
If you click Continue, the application will ignore this error and attempt to continue.
3223+
3224+
{1}.</value>
31973225
</data>
31983226
<data name="ExDlgSecurityErrorText" xml:space="preserve">
3199-
<value>Application attempted to perform an operation not allowed by the security policy. To grant this application the required permission, contact your system administrator, or use the Microsoft .NET Framework Configuration tool.\r\n\r\nIf you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.\r\n\r\n{1}.</value>
3227+
<value>Application attempted to perform an operation not allowed by the security policy. To grant this application the required permission, contact your system administrator, or use the Microsoft .NET Framework Configuration tool.
3228+
3229+
If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.
3230+
3231+
{1}.</value>
32003232
</data>
32013233
<data name="ExDlgShowDetails" xml:space="preserve">
32023234
<value>&amp;Details</value>
@@ -3259,10 +3291,12 @@
32593291
<value>Too many files selected. Select fewer files and try again.</value>
32603292
</data>
32613293
<data name="FileDialogCreatePrompt" xml:space="preserve">
3262-
<value>File {0} does not exist.\r\nDo you want to create it?</value>
3294+
<value>File {0} does not exist.
3295+
Do you want to create it?</value>
32633296
</data>
32643297
<data name="FileDialogFileNotFound" xml:space="preserve">
3265-
<value>File {0} does not exist.\r\nVerify that the correct file name was given.</value>
3298+
<value>File {0} does not exist.
3299+
Verify that the correct file name was given.</value>
32663300
</data>
32673301
<data name="FileDialogInvalidFileName" xml:space="preserve">
32683302
<value>File {0} is not a valid file name.</value>
@@ -3274,7 +3308,8 @@
32743308
<value>Filter index not valid.</value>
32753309
</data>
32763310
<data name="FileDialogOverwritePrompt" xml:space="preserve">
3277-
<value>File {0} already exists.\r\nDo you want to replace it?</value>
3311+
<value>File {0} already exists.
3312+
Do you want to replace it?</value>
32783313
</data>
32793314
<data name="FileDialogSubLassFailure" xml:space="preserve">
32803315
<value>Attempt to subclass a list box did not succeed. Not enough memory is available.</value>
@@ -3622,7 +3657,9 @@
36223657
<value>Cross-thread operation not valid: Control '{0}' accessed from a thread other than the thread it was created on.</value>
36233658
</data>
36243659
<data name="IllegalCrossThreadCallWithStack" xml:space="preserve">
3625-
<value>Cross-thread operation not valid: Control '{0}' accessed from a thread other than the thread it was created on.\r\nStack trace where the illegal operation occurred was:\r\n{1}"</value>
3660+
<value>Cross-thread operation not valid: Control '{0}' accessed from a thread other than the thread it was created on.
3661+
Stack trace where the illegal operation occurred was:
3662+
{1}"</value>
36263663
</data>
36273664
<data name="IllegalState" xml:space="preserve">
36283665
<value>Internal state of the {1} class is not valid.</value>
@@ -5626,7 +5663,9 @@
56265663
<value>Security</value>
56275664
</data>
56285665
<data name="SecurityRestrictedText" xml:space="preserve">
5629-
<value>Window is running in a restricted mode. Some UI features may be disabled for security reasons. \r\n\r\nFor more information, contact your system administrator or the application author.</value>
5666+
<value>Window is running in a restricted mode. Some UI features may be disabled for security reasons.
5667+
5668+
For more information, contact your system administrator or the application author.</value>
56305669
</data>
56315670
<data name="SecurityRestrictedWindowTextMixedZone" xml:space="preserve">
56325671
<value>Mixed Zone</value>
@@ -5674,10 +5713,14 @@
56745713
<value>Source: {0}</value>
56755714
</data>
56765715
<data name="SecurityToolTipTextFormat" xml:space="preserve">
5677-
<value>{0}\r\n\r\n{1}</value>
5716+
<value>{0}
5717+
5718+
{1}</value>
56785719
</data>
56795720
<data name="SecurityUnrestrictedText" xml:space="preserve">
5680-
<value>Window is running in an unrestricted mode. Although the main window is running unrestricted, some features may be disabled for security reasons. \r\n\r\nFor more information, contact your system administrator or the application author.</value>
5721+
<value>Window is running in an unrestricted mode. Although the main window is running unrestricted, some features may be disabled for security reasons.
5722+
5723+
For more information, contact your system administrator or the application author.</value>
56815724
</data>
56825725
<data name="SecurityVersionColumn" xml:space="preserve">
56835726
<value>Assembly Version</value>
@@ -7051,10 +7094,12 @@
70517094
<value>MoreInformationLink</value>
70527095
</data>
70537096
<data name="TrustManagerPromptUI_NoPublisherInstallQuestion" xml:space="preserve">
7054-
<value>Publisher cannot be verified.\r\nAre you sure you want to install this application?</value>
7097+
<value>Publisher cannot be verified.
7098+
Are you sure you want to install this application?</value>
70557099
</data>
70567100
<data name="TrustManagerPromptUI_NoPublisherRunQuestion" xml:space="preserve">
7057-
<value>Publisher cannot be verified.\r\nAre you sure you want to run this application?</value>
7101+
<value>Publisher cannot be verified.
7102+
Are you sure you want to run this application?</value>
70587103
</data>
70597104
<data name="TrustManagerPromptUI_Close" xml:space="preserve">
70607105
<value>Close</value>

0 commit comments

Comments
 (0)