From 87c618aeb87dbfea859c514a12ae0215fb961647 Mon Sep 17 00:00:00 2001 From: "Tylah Kapa [SSW]" Date: Mon, 11 Dec 2023 08:45:16 +1000 Subject: [PATCH 1/3] Rename rule and update uri --- ...-better-interfaces-windows-applications.md | 2 +- .../rule.md | 27 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/categories/design-and-presentation/rules-to-better-interfaces-windows-applications.md b/categories/design-and-presentation/rules-to-better-interfaces-windows-applications.md index acadc1e11f9..415a847101b 100644 --- a/categories/design-and-presentation/rules-to-better-interfaces-windows-applications.md +++ b/categories/design-and-presentation/rules-to-better-interfaces-windows-applications.md @@ -8,7 +8,7 @@ index: - title-bar-do-you-put-your-company-url-in-the-title-bar - menu-do-you-use-icons-in-menu - sound-do-you-realize-the-importance-of-sounds-to-user-interface -- sound-did-you-know-that-a-message-box-automatically-plays-a-beep +- sound-message-box - long-process-do-you-know-how-to-make-long-running-processes-user-friendly - long-process-do-you-show-the-status-of-progress-bar-on-winforms-title - long-process-do-you-know-that-long-running-processes-should-allow-to-skip-the-processing-when-appropriate diff --git a/rules/sound-did-you-know-that-a-message-box-automatically-plays-a-beep/rule.md b/rules/sound-did-you-know-that-a-message-box-automatically-plays-a-beep/rule.md index 3718854e51f..f59b4821a1b 100644 --- a/rules/sound-did-you-know-that-a-message-box-automatically-plays-a-beep/rule.md +++ b/rules/sound-did-you-know-that-a-message-box-automatically-plays-a-beep/rule.md @@ -1,12 +1,13 @@ --- type: rule title: Sound - Did you know that a message box automatically plays a beep? -uri: sound-did-you-know-that-a-message-box-automatically-plays-a-beep +uri: sound-message-box authors: - title: Adam Cogan url: https://ssw.com.au/people/adam-cogan related: [] -redirects: [] +redirects: + - sound-did-you-know-that-a-message-box-automatically-plays-a-beep created: 2012-11-27T02:57:30.000Z archivedreason: null guid: 81d5da16-4a3d-420e-b92c-f73a0791b290 @@ -20,22 +21,22 @@ A message box automatically provides this functionality so there is no need to m ![Figure: Good example - Windows message boxes plays a sound... which cannot be captured in screenshot form.](../../assets/Win7SoundError.png) ::: -```vbnet -Dim Message As String = "You did not enter a server name. Cancel this operation?" -Dim Caption As String = "No Server Name Specified" -Dim Buttons As Integer = MessageBoxButtons.YesNo -Beep() -result = MessageBox.Show( Me, Message, Caption, Buttons) +```csharp +string message = "You did not enter a server name. Cancel this operation?"; +string caption = "No Server Name Specified"; +MessageBoxButtons buttons = MessageBoxButtons.YesNo; +System.Media.SystemSounds.Beep.Play(); +DialogResult result = MessageBox.Show(this, message, caption, buttons); ``` ::: bad Figure: Bad example - The sound on the button is hardcoded in this code snippet ::: -```vbnet -Dim Message As String = "You did not enter a server name. Cancel this operation?" -Dim Caption As String = "No Server Name Specified" -Dim Buttons As Integer = MessageBoxButtons.YesNo -result = MessageBox.Show( Me, Message, Caption, Buttons) +```csharp +string message = "You did not enter a server name. Cancel this operation?"; +string caption = "No Server Name Specified"; +MessageBoxButtons buttons = MessageBoxButtons.YesNo; +DialogResult result = MessageBox.Show(this, message, caption, buttons); ``` ::: good Figure: Good example - The code is not present in this example as it is automatically done From 4c94eb7b30b9c2ee88a960323862eee36b9be368 Mon Sep 17 00:00:00 2001 From: "Tylah Kapa [SSW]" Date: Mon, 11 Dec 2023 08:46:52 +1000 Subject: [PATCH 2/3] Rename folder --- .../rule.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename rules/{sound-did-you-know-that-a-message-box-automatically-plays-a-beep => sound-message-box}/rule.md (100%) diff --git a/rules/sound-did-you-know-that-a-message-box-automatically-plays-a-beep/rule.md b/rules/sound-message-box/rule.md similarity index 100% rename from rules/sound-did-you-know-that-a-message-box-automatically-plays-a-beep/rule.md rename to rules/sound-message-box/rule.md From b8a91ccb4d352b29dffc8e4e7bac2ff57417c5d5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 10 Dec 2023 22:48:25 +0000 Subject: [PATCH 3/3] Auto-fix Markdown files --- .../rules-to-better-interfaces-windows-applications.md | 1 - rules/sound-message-box/rule.md | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/categories/design-and-presentation/rules-to-better-interfaces-windows-applications.md b/categories/design-and-presentation/rules-to-better-interfaces-windows-applications.md index 415a847101b..51f9d180d2d 100644 --- a/categories/design-and-presentation/rules-to-better-interfaces-windows-applications.md +++ b/categories/design-and-presentation/rules-to-better-interfaces-windows-applications.md @@ -30,4 +30,3 @@ index: Since 1990, SSW has supported the developer community by publishing all our best practices and rules for everyone to see. If you still need help, visit [Website Design and User Experience](http://www.ssw.com.au/ssw/Consulting/WebsiteDesignAndUserExperience.aspx) and book in a consultant. - diff --git a/rules/sound-message-box/rule.md b/rules/sound-message-box/rule.md index f59b4821a1b..24c4b6feea2 100644 --- a/rules/sound-message-box/rule.md +++ b/rules/sound-message-box/rule.md @@ -28,6 +28,7 @@ MessageBoxButtons buttons = MessageBoxButtons.YesNo; System.Media.SystemSounds.Beep.Play(); DialogResult result = MessageBox.Show(this, message, caption, buttons); ``` + ::: bad Figure: Bad example - The sound on the button is hardcoded in this code snippet ::: @@ -38,6 +39,7 @@ string caption = "No Server Name Specified"; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result = MessageBox.Show(this, message, caption, buttons); ``` + ::: good Figure: Good example - The code is not present in this example as it is automatically done :::