Skip to content

Commit

Permalink
Merge pull request #11 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 379b9c6 + 3988dd2 commit 5b6b6aa
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 35 deletions.
31 changes: 19 additions & 12 deletions DisksizeWatcher/MainForm.Designer.cs

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

11 changes: 9 additions & 2 deletions DisksizeWatcher/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,28 @@ private void ToolStripSplitButtonSettings_ButtonClick(object sender, EventArgs e
}
using (SettingsForm settingsForm = new SettingsForm())
{
settingsForm.StayOnTop = menuitemStayOnTop.Checked;
settingsForm.MinimizeToSystemTray = menuitemMinimizeToSystemTray.Checked;
DialogResult dialogResult = settingsForm.ShowDialog();
if (dialogResult == DialogResult.OK)
{
menuitemStayOnTop.Checked = settingsForm.StayOnTop;
menuitemMinimizeToSystemTray.Checked = settingsForm.MinimizeToSystemTray;
}
}
if (menuitemStayOnTop.Checked)
{
TopMost = true;
}
}

private void MenuitemStayOnTop_Click(object sender, EventArgs e) => TopMost = menuitemStayOnTop.Checked;
private void MenuitemStayOnTop_CheckedChanged(object sender, EventArgs e) => TopMost = menuitemStayOnTop.Checked;

private void MainForm_Resize(object sender, EventArgs e)
{
if (WindowState == FormWindowState.Minimized)
{
if (menuitemMinimizeToTray.Checked)
if (menuitemMinimizeToSystemTray.Checked)
{
Hide();
notifyIcon.Visible = true;
Expand Down
2 changes: 1 addition & 1 deletion DisksizeWatcher/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.0.3")]
[assembly: AssemblyFileVersion("0.0.0.3")]
[assembly: AssemblyFileVersion("0.1.0.3")]
[assembly: NeutralResourcesLanguage("en")]
29 changes: 18 additions & 11 deletions DisksizeWatcher/SettingsForm.Designer.cs

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

35 changes: 26 additions & 9 deletions DisksizeWatcher/SettingsForm.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DisksizeWatcher
{
public partial class SettingsForm : Form
{
public SettingsForm()
public bool StayOnTop
{
get
{
return checkBoxStayOnTop.Checked;
}
set
{
checkBoxStayOnTop.Checked = value;
}
}
public bool MinimizeToSystemTray
{
get
{
return checkBoxMinimizeToSystemTray.Checked;
}
set
{
checkBoxMinimizeToSystemTray.Checked = value;
}
}

public SettingsForm() => InitializeComponent();

private void SettingsForm_Load(object sender, EventArgs e)
{
InitializeComponent();
}
}
}

0 comments on commit 5b6b6aa

Please sign in to comment.