Skip to content

Commit

Permalink
Merge branch 'main' into migration---avoid-using-single-chart-when-sc…
Browse files Browse the repository at this point in the history
…aled
  • Loading branch information
jeoffreyfischer committed Mar 25, 2024
2 parents 75b2fd2 + 5ddc58c commit 66e8e4d
Show file tree
Hide file tree
Showing 41 changed files with 645 additions and 18 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
type: rule
title: Do you always set FirstDayOfWeek to Monday on a MonthCalendar?
uri: always-set-firstdayofweek-to-monday-on-a-monthcalendar
authors:
- title: Adam Cogan
url: https://ssw.com.au/people/adam-cogan/
created: 2014-03-14T02:02:00.000Z
guid: 4207265d-5968-4baf-a294-df489fa32517
---
It is always good idea to set FirstDayOfWeek property to Monday to initialize it instead of leave it with the dafault value.

<!--endintro-->

::: bad
![Figure: Bad example - FirstDayOfWeek is default](monthcalendarfirstdayofweekbad.gif)
:::

::: good
![Figure: Good example - FirstDayOfWeek set to Monday](monthcalendarfirstdayofweekgood.gif)
:::
25 changes: 25 additions & 0 deletions rules/always-use-gridview-instead-of-listbox/rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
type: rule
title: Do you always use GridView instead of ListBox?
uri: always-use-gridview-instead-of-listbox
authors:
- title: Adam Cogan
url: https://ssw.com.au/people/adam-cogan/
created: 2014-03-14T02:01:00.000Z
guid: 62fdd9ea-cbec-4e93-8547-1da7c2ec13fa
---
Always choose a GridView (over a ListBox) because it can have:

<!--endintro-->

1. Multiple columns
2. Checkboxes in the header of the control, which enables users to easily check or uncheck all items
3. Add sub-controls added such as buttons, links, charts, and even customized controls to the Gridview. This means you get unlimited flexibility with the GridView

::: bad
![Figure: Bad example - No header rows and no checkbox to check or uncheck all items. None of this can be done with the ListView](datagridviewbad.png)
:::

::: good
![Figure: Good example - A header row and a checkbox to control all items, and multiple columns give users a richer experience. This can all be done using a GridView](datagridviewgood.png)
:::
3 changes: 2 additions & 1 deletion rules/close-off-thread/rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ authors:
url: https://www.ssw.com.au/people/adam-cogan
related:
- dones-do-you-reply-done-and-delete-the-original-email
- dones-do-you-include-useful-details-in-your-done-email
created: 2023-09-18T20:52:37.996Z
guid: dc9b3dc3-e7a4-4303-ad58-db8ee29936da
---
Expand All @@ -24,6 +25,6 @@ When handling email threads within instant messaging (IM), adding a **"Done - se

* Employ it when a task related to an email is complete
* Specify action details in the email if necessary
* Summarize key points in complex email threads
* Summarize key points in complex email threads

Close off a thread by "Done - see email" in IM to streamline conversations, reduce overload, and maintain organized records, ultimately improving productivity.
20 changes: 9 additions & 11 deletions rules/do-you-constantly-add-to-the-backlog/rule.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
---
type: rule
archivedreason:
title: Do you constantly add to the backlog?
guid: 0ec0aa24-4e04-4c7f-b386-9fa76d180a1c
uri: do-you-constantly-add-to-the-backlog
created: 2009-02-27T00:56:56.0000000Z
authors:
- title: Adam Cogan
url: https://ssw.com.au/people/adam-cogan
- title: Eric Phan
url: https://ssw.com.au/people/eric-phan
- title: Adam Cogan
url: https://ssw.com.au/people/adam-cogan
- title: Eric Phan
url: https://ssw.com.au/people/eric-phan
related:
- fix-small-web-errors
- fix-small-web-errors
redirects: []

created: 2009-02-27T00:56:56.000Z
archivedreason: null
guid: 0ec0aa24-4e04-4c7f-b386-9fa76d180a1c
---

In the course of work everyone encounters bugs or problems. They can be dealt with by either:

1. Pretend you didn't see the problem
Expand All @@ -26,7 +24,7 @@ In the course of work everyone encounters bugs or problems. They can be dealt wi

The best solution is to use a combination of 2 and 3.

* If it will take less 15 mins to fix, do it [straight away](/fix-small-web-errors).
* If it will take less than 15 minutes to fix, do it [straight away](/fix-small-web-errors).
* If it will take more time, add the problem to the Product Backlog and email a link to the appropriate person (even if it’s a third party product).

This approach raises the question of priorities. If you hit too many hurdles you continually get diverted from the main task. For example when fixing the Client form you encounter a problem with the Client Contact form which breaks the Products form etc. (This can be described as the "Tree Approach" as opposed to the "Straight through to the Goal approach".)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions rules/do-you-save-user-settings-and-reuse-them-by-default/rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
type: rule
title: Do you save user settings and reuse them by default?
uri: do-you-save-user-settings-and-reuse-them-by-default
authors:
- title: Adam Cogan
url: https://ssw.com.au/people/adam-cogan/
created: 2014-03-14T00:22:00.000Z
guid: 4fbed628-95fc-4d29-9637-12b6df5958b7
---
There should always be default values in your application if you allow users to change the settings. This will help your users to have a better first time experience and insure the application work as expected.

<!--endintro-->

However when the users change settings for their own preference, it is better to save these settings and give user has a better return experience, your application looks smarter in this way.

![Figure: Save user setting](defaultvalue.png)
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ related:
- definition-of-done
- comments-do-you-enforce-comments-with-check-ins
- do-you-add-context-reasoning-to-your-emails
- close-off-thread
redirects: []
created: 2011-05-29T16:10:16.000Z
archivedreason: null
Expand Down Expand Up @@ -42,7 +43,7 @@ In any email you send, **include relevant information**, such as [URLs](/dones-d
| Subject: | RE: Northwind - Include one more field to the form |
::: email-content

### Hi Dave,
### Hi Dave

Done on the contact page

Expand All @@ -59,7 +60,7 @@ Figure: Bad example - "Done" email lacks details
| Subject: | RE: Northwind - Include one more field to the form |
::: email-content

### Hi Dave,
### Hi Dave

Done - added "State" field to the contact form - northwind&#46;com/contact

Expand All @@ -76,6 +77,6 @@ Figure: Good example - "Done" email has a link, a screenshot, and code changes
### Tips

* [Use balloons instead of a 'Wall of Text'](/screenshots-do-you-use-balloons-instead-of-a-wall-of-text)
* On browser screenshots, make sure you include the top-left area - so others can see the URL and what browser is being used. E.g. Chrome or Edge
* On browser screenshots, make sure you include the top-left area - so others can see the URL and what browser is being used. E.g. Chrome or Edge
* If you are using Azure DevOps or GitHub, you should also include a URL to the work item
* Include a [.diff file](https://www.diffchecker.com/) for greater code/text changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
type: rule
title: Do you have a ResetDefault() function to handle messed up user settings?
uri: have-a-resetdefault-function-to-handle-messed-up-user-settings
authors:
- title: Adam Cogan
url: https://ssw.com.au/people/adam-cogan/
created: 2014-03-14T00:22:00.000Z
guid: 6696b1b2-dcd7-475a-990e-b5d610f0a122
---
In development life cycle, developers always have different settings to the user's settings. Because of this, debug settings won't always work on the remote machine.

In order to have settings.config, we also have a defaults.config. This is good because this gives a chance for the user to roll back bad settings without reinstalling the application. The application can also roll back the settings it automatically. Below is the code that what we do.

<!--endintro-->

VB.NET

```vb
Public Sub RuneXtremeEmail(ByVal state As Object)

If Environment.MachineName <> Configuration.MachineName Then

resetSettings()

Else
End
```

We have a program called [SSW Code Auditor](https://ssw.com.au/ssw/CodeAuditor/) to check for this rule.

We have a program called [SSW .NET Toolkit](https://ssw.com.au/ssw/NETToolkit/) that implements this rule.

*Note: in Access we do like this*

```vb
Private Sub Form_Load()

If Nz(DLookup("CurrentComputerName", "ControlLocal", "ID=1"), "") <> CurrentComputerName
Then
Me.ctlCurrentComputerName.Value = CurrentComputerName
Else ...
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions rules/include-back-and-undo-buttons-on-every-form/rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
type: rule
title: Do you include "Back" and "Undo" buttons on every form?
uri: include-back-and-undo-buttons-on-every-form
authors:
- title: Adam Cogan
url: https://ssw.com.au/people/adam-cogan
created: 2014-03-14T00:22:00.000Z
guid: 3fbae7db-7cec-4daa-8371-47261cd6117b
---

Following on from including a URL, almost every form should have a Back and an Undo button which takes you back to the previous screen, or reverses the last action. This is just like Outlook (see figure below), it has a Back button to take you to the previous folder and an Undo button.

<!--endintro-->

::: good
![Figure: Good example - Back & Undo buttons in Outlook Advanced toolbar](outlookviewbar.jpg)
:::

**Notes:**
- "Back" button should only be implemented if different views can be shown in the same window
- Don't put "Undo" buttons on non data entry forms such as a Print Preview form

The list of forms/URLs and the order in which they have been accessed should be stored in a DataSet held in memory (like IE) - not saved to disk.

For example:

| **Menu** | **Action** | **Undo** | **Back** |
| ----------- | ----------------------------------------------------------------- | -------------------- | ----------- |
| Cut | Remember: Remember Text and Cursor Position <br>Cut To Clipboard | Return to Remember | n/a |
| Save Record | Remember old values <br>Execute procCustomerSave <br>Close Form | Return to Old values | Reopen form |

Sample code implementation in the [SSW .NET Toolkit](https://ssw.com.au/ssw/NETToolkit).
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
type: rule
title: Do you know how to run write application to run with UAC turn on?
uri: know-how-to-run-write-application-to-run-with-uac-turn-on
authors:
- title: Adam Cogan
url: https://ssw.com.au/people/adam-cogan/
created: 2014-03-14T02:02:00.000Z
guid: d159fc8d-8b7f-4eb3-b6b8-8c193e69ca05
---
Some applications may need to have administrator right for running the application, e.g. create a file, access system library, etc. It will be an issue for the application to run if UAC is turned on. Below is the step to solve the issue:

<!--endintro-->

1. Add App.Manifest into WindowsUI project. It should contain the below code:

```xml
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</asmv1:assembly>
```

**App.Manifest**

2. Change the project settings for WindowsUI to use the newly created App.Manifest.

![Figure: Use the newly created App.Manifest](setmanifest.jpg)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions rules/make-common-controls-with-consistent-widths/rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
type: rule
title: Do you make common controls with consistent widths?
uri: make-common-controls-with-consistent-widths
authors:
- title: Adam Cogan
url: https://ssw.com.au/people/adam-cogan/
created: 2014-03-14T00:22:00.000Z
guid: abfaa422-644f-4b9f-afa0-9c0374e097b2
---

There are a few common controls we always use in our products. For example, DateTime and Ellipsis Button. We need a standard for the width so the controls should be more consistent.

<!--endintro-->

**Note:** Controls on base forms will be made to be 'protected' rather than 'private', especially so that inherited forms of different sizes don't mess up.

::: bad
![Figure: Bad example - Control sizes are not consistent](commoncontrolbad.gif)
:::

::: good
![Figure: Good example - Control sizes are all standard and consistent](commoncontrolgood.gif)
:::

::: bad
![Figure: Bad example - Non-standard size for Add & Delete buttons](adddeletebad.gif)
:::

::: good
![Figure: Good example - Standard size for Add & Delete buttons](adddeletegood.gif)
:::

We have a program called [SSW Code Auditor](https://ssw.com.au/ssw/CodeAuditor/Rules.aspx#CommonControl) to check for the following two rules:

**Rule - C#/VB.NET UI- Button Height and Width - for Standard Button (75 x 23 pixels)**
- **Level 2:** All buttons \< 6 characters:** Check the standard size (75 X 23 pixels) for buttons with the word length less than or equal to six characters, except the following buttons.
- **Level 1:** The action buttons:** Check the standard size (75 X 23 pixels) for the following action buttons:

- Add
- Delete
- Edit
- OK
- Close
- Cancel
- Save
- Browse
- Select
- Test<
- Next
- Back
- Remove
- Refresh (Exception to the rule as it has 7 letters)
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
type: rule
title: Do you prevent users from running two instances of your application?
uri: prevent-users-from-running-two-instances-of-your-application
authors:
- title: Adam Cogan
url: https://ssw.com.au/people/adam-cogan/
created: 2014-03-14T00:22:00.000Z
guid: 9fcfbe56-37b2-4f74-9247-12151fd21c8f
---

In some cases, running two instances of an application at the same time may cause unexpected result. See this issue is solved via the code below on [SSW Exchange Reporter](/ssw/ExchangeReporter/):

<!--endintro-->

```cs
try
{
Process current = Process.GetCurrentProcess();
Process[] processes = Process.GetProcessesByName( current.ProcessName);

if ( processes.Length>1 )
{
DialogResult userOption = MessageBox.Show(Application.ProductName + " is already running on this machine. " + Environment.NewLine+Environment.NewLine + "Please click: "+Environment.NewLine+
" - 'Try again' to exit the other instance and try again, or "+Environment.NewLine+
" - 'Cancel' to exit now."+Environment.NewLine,
Application.ProductName+" "+(new Version(Application.ProductVersion)).ToString(2),

MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning);
switch(userOption)
{
case DialogResult.Cancel: return;

case DialogResult.Retry:
foreach(Process currProcess in processes)
{
if ( currProcess.Id != current.Id)
{
currProcess.Kill();
}
}
break;
}
}
}
catch (Exception ex)
{
TracingHelper.Trace(null, Loggers.WindowsUILogger, TracingLevels.DEBUG, "Cannot get process information, Excpetion occured.", ex) ;

DialogResult result = MessageBox.Show("Exchange Reporter cannot detect process information. This may be caused by disabled 'Performance Counter' on your machine. "+Environment.NewLine+
"In such case, Exchange Reporter cannot ensure there is only one instance running. "+
Environment.NewLine+
"You may continue to run Exchange Reporter, however, please make sure you have only one instance of Exchange Reporter running. "+
Environment.NewLine+
"Multiple instances will cause unexpected behaviour. "+
Environment.NewLine+Environment.NewLine+
"Please click 'OK' to continue, or click 'Cancel' to quit."
, Application.ProductName+" "+(new Version(Application.ProductVersion)).ToString(2),
MessageBoxButtons.OKCancel,
MessageBoxIcon.Warning);

if ( result == DialogResult.Cancel)
{
return;
}
}
```
**Code: Avoid running two instances of an application**

Loading

0 comments on commit 66e8e4d

Please sign in to comment.