Skip to content

Commit

Permalink
Merge pull request #12 from Mijo-Software/mjohne-patch-1
Browse files Browse the repository at this point in the history
Add files via upload
  • Loading branch information
mjohne authored Aug 4, 2020
2 parents 5b6b6aa + a5d3cbd commit 88c9c0d
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
70 changes: 70 additions & 0 deletions DisksizeWatcher/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions DisksizeWatcher/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ private void SetStatusbarText(string text)
/// <remarks>The parameters <paramref name="e"/> and <paramref name="sender"/> are not needed, but must be indicated.</remarks>
private void MainForm_Load(object sender, EventArgs e)
{
SetStatusbarText(text: string.Empty);
notifyIcon.Visible = false;
if (driveC.IsReady)
{
Expand All @@ -43,6 +44,46 @@ private void MainForm_Load(object sender, EventArgs e)
timer.Start();
}

/// <summary>
/// Detect the accessibility description to set as information text in the status bar
/// </summary>
/// <param name="sender">object sender</param>
/// <param name="e">event arguments</param>
/// <remarks>The parameter <paramref name="e"/> is not needed, but must be indicated.</remarks>
private void SetStatusbar_Enter(object sender, EventArgs e)
{
string text = string.Empty;
if (sender is Control control)
{
text = control.AccessibleDescription;
}
else if (sender is ToolStripSplitButton toolStripSplitButton)
{
text = toolStripSplitButton.AccessibleDescription;
}
else if (sender is ToolStripButton toolStripButton)
{
text = toolStripButton.AccessibleDescription;
}
else if (sender is ToolStripLabel toolStripLabel)
{
text = toolStripLabel.AccessibleDescription;
}
else if (sender is ToolStripMenuItem toolStripMenuItem)
{
text = toolStripMenuItem.AccessibleDescription;
}
SetStatusbarText(text: text);
}

/// <summary>
/// Clear the information text of the status bar
/// </summary>
/// <param name="sender">object sender</param>
/// <param name="e">event arguments</param>
/// <remarks>The parameters <paramref name="e"/> and <paramref name="sender"/> are not needed, but must be indicated.</remarks>
private void ClearStatusbar_Leave(object sender, EventArgs e) => SetStatusbarText(text: string.Empty);

/// <summary>
/// Perform the timer
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions DisksizeWatcher/SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public bool StayOnTop
checkBoxStayOnTop.Checked = value;
}
}

public bool MinimizeToSystemTray
{
get
Expand Down

0 comments on commit 88c9c0d

Please sign in to comment.