# HG changeset patch # User Brad Greco # Date 1555370665 14400 # Node ID 75ca86e0862c106730095e070a6908f072debe53 # Parent 9e77c0dccb66a09b25432116324b3463f09f6bf9 Add setting to hide to notification area. diff -r 9e77c0dccb66 -r 75ca86e0862c ServerMonitor/App.config --- a/ServerMonitor/App.config Mon Apr 08 21:31:03 2019 -0400 +++ b/ServerMonitor/App.config Mon Apr 15 19:24:25 2019 -0400 @@ -35,6 +35,9 @@ + + True + diff -r 9e77c0dccb66 -r 75ca86e0862c ServerMonitor/Forms/CheckForm.Designer.cs --- a/ServerMonitor/Forms/CheckForm.Designer.cs Mon Apr 08 21:31:03 2019 -0400 +++ b/ServerMonitor/Forms/CheckForm.Designer.cs Mon Apr 15 19:24:25 2019 -0400 @@ -307,6 +307,11 @@ 0, 0, 0}); + this.FrequencyUpDown.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); this.FrequencyUpDown.Name = "FrequencyUpDown"; this.FrequencyUpDown.Size = new System.Drawing.Size(49, 20); this.FrequencyUpDown.TabIndex = 28; diff -r 9e77c0dccb66 -r 75ca86e0862c ServerMonitor/Forms/ServerSummaryForm.cs --- a/ServerMonitor/Forms/ServerSummaryForm.cs Mon Apr 08 21:31:03 2019 -0400 +++ b/ServerMonitor/Forms/ServerSummaryForm.cs Mon Apr 15 19:24:25 2019 -0400 @@ -192,7 +192,7 @@ private void ServerSummaryForm_FormClosing(object sender, FormClosingEventArgs e) { - if (e.CloseReason == CloseReason.None || e.CloseReason == CloseReason.UserClosing) + if ((e.CloseReason == CloseReason.None || e.CloseReason == CloseReason.UserClosing) && Settings.Default.HideToNotificationArea) { Hide(); e.Cancel = true; @@ -297,7 +297,7 @@ //System.Threading.Thread.Sleep(5000); UpdateManager manager = UpdateManager.Instance; manager.ReinstateIfRestarted(); - manager.UpdateSource = new SimpleWebSource(@"c:\temp\feed.xml"); + manager.UpdateSource = new SimpleWebSource("https://www.bgreco.net/test/servermonitor.xml"); if (manager.State == UpdateManager.UpdateProcessState.NotChecked) manager.BeginCheckForUpdates(CheckForUpdatesCallback, null); } diff -r 9e77c0dccb66 -r 75ca86e0862c ServerMonitor/Forms/SettingsForm.Designer.cs --- a/ServerMonitor/Forms/SettingsForm.Designer.cs Mon Apr 08 21:31:03 2019 -0400 +++ b/ServerMonitor/Forms/SettingsForm.Designer.cs Mon Apr 15 19:24:25 2019 -0400 @@ -45,6 +45,7 @@ this.DeleteLabel = new System.Windows.Forms.Label(); this.DaysLabel = new System.Windows.Forms.Label(); this.AutorunCheckBox = new System.Windows.Forms.CheckBox(); + this.KeepRunningCheckBox = new System.Windows.Forms.CheckBox(); this.SeverityOptionsGroupBox.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.InformationIcon)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.WarningIcon)).BeginInit(); @@ -54,7 +55,7 @@ // // SeverityOptionsGroupBox // - this.SeverityOptionsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.SeverityOptionsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.SeverityOptionsGroupBox.Controls.Add(this.ErrorComboBox); this.SeverityOptionsGroupBox.Controls.Add(this.WarningComboBox); @@ -65,7 +66,7 @@ this.SeverityOptionsGroupBox.Controls.Add(this.WarningIcon); this.SeverityOptionsGroupBox.Controls.Add(this.ErrorLabel); this.SeverityOptionsGroupBox.Controls.Add(this.ErrorIcon); - this.SeverityOptionsGroupBox.Location = new System.Drawing.Point(12, 89); + this.SeverityOptionsGroupBox.Location = new System.Drawing.Point(12, 109); this.SeverityOptionsGroupBox.Name = "SeverityOptionsGroupBox"; this.SeverityOptionsGroupBox.Size = new System.Drawing.Size(337, 104); this.SeverityOptionsGroupBox.TabIndex = 8; @@ -169,7 +170,7 @@ // OkButton // this.OkButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.OkButton.Location = new System.Drawing.Point(193, 204); + this.OkButton.Location = new System.Drawing.Point(193, 224); this.OkButton.Name = "OkButton"; this.OkButton.Size = new System.Drawing.Size(75, 23); this.OkButton.TabIndex = 50; @@ -181,7 +182,7 @@ // this.CancelSettingsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.CancelSettingsButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.CancelSettingsButton.Location = new System.Drawing.Point(274, 204); + this.CancelSettingsButton.Location = new System.Drawing.Point(274, 224); this.CancelSettingsButton.Name = "CancelSettingsButton"; this.CancelSettingsButton.Size = new System.Drawing.Size(75, 23); this.CancelSettingsButton.TabIndex = 51; @@ -191,7 +192,7 @@ // // KeepLogDaysInput // - this.KeepLogDaysInput.Location = new System.Drawing.Point(130, 59); + this.KeepLogDaysInput.Location = new System.Drawing.Point(130, 81); this.KeepLogDaysInput.Maximum = new decimal(new int[] { 9999, 0, @@ -204,7 +205,7 @@ // DeleteLabel // this.DeleteLabel.AutoSize = true; - this.DeleteLabel.Location = new System.Drawing.Point(15, 61); + this.DeleteLabel.Location = new System.Drawing.Point(15, 83); this.DeleteLabel.Name = "DeleteLabel"; this.DeleteLabel.Size = new System.Drawing.Size(113, 13); this.DeleteLabel.TabIndex = 5; @@ -213,7 +214,7 @@ // DaysLabel // this.DaysLabel.AutoSize = true; - this.DaysLabel.Location = new System.Drawing.Point(182, 61); + this.DaysLabel.Location = new System.Drawing.Point(182, 83); this.DaysLabel.Name = "DaysLabel"; this.DaysLabel.Size = new System.Drawing.Size(29, 13); this.DaysLabel.TabIndex = 7; @@ -229,13 +230,24 @@ this.AutorunCheckBox.Text = "&Start with Windows"; this.AutorunCheckBox.UseVisualStyleBackColor = true; // + // KeepRunningCheckBox + // + this.KeepRunningCheckBox.AutoSize = true; + this.KeepRunningCheckBox.Location = new System.Drawing.Point(18, 59); + this.KeepRunningCheckBox.Name = "KeepRunningCheckBox"; + this.KeepRunningCheckBox.Size = new System.Drawing.Size(219, 17); + this.KeepRunningCheckBox.TabIndex = 52; + this.KeepRunningCheckBox.Text = "&Minimize to notification area when closed"; + this.KeepRunningCheckBox.UseVisualStyleBackColor = true; + // // SettingsForm // this.AcceptButton = this.OkButton; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.CancelSettingsButton; - this.ClientSize = new System.Drawing.Size(361, 239); + this.ClientSize = new System.Drawing.Size(361, 259); + this.Controls.Add(this.KeepRunningCheckBox); this.Controls.Add(this.AutorunCheckBox); this.Controls.Add(this.DaysLabel); this.Controls.Add(this.DeleteLabel); @@ -279,5 +291,6 @@ private System.Windows.Forms.Label DeleteLabel; private System.Windows.Forms.Label DaysLabel; private System.Windows.Forms.CheckBox AutorunCheckBox; + private System.Windows.Forms.CheckBox KeepRunningCheckBox; } } \ No newline at end of file diff -r 9e77c0dccb66 -r 75ca86e0862c ServerMonitor/Forms/SettingsForm.cs --- a/ServerMonitor/Forms/SettingsForm.cs Mon Apr 08 21:31:03 2019 -0400 +++ b/ServerMonitor/Forms/SettingsForm.cs Mon Apr 15 19:24:25 2019 -0400 @@ -32,6 +32,7 @@ comboBox.Format += FailActionComboBox_Format; } AutorunCheckBox.Checked = GetAutorun(); + KeepRunningCheckBox.Checked = Settings.Default.HideToNotificationArea; KeepLogDaysInput.Value = Settings.Default.KeepLogDays; ErrorComboBox.SelectedItem = Settings.Default.ErrorAction; WarningComboBox.SelectedItem = Settings.Default.WarningAction; @@ -61,6 +62,7 @@ private void OkButton_Click(object sender, EventArgs e) { + Settings.Default.HideToNotificationArea = KeepRunningCheckBox.Checked; Settings.Default.KeepLogDays = (int)KeepLogDaysInput.Value; Settings.Default.ErrorAction = (FailAction)ErrorComboBox.SelectedItem; Settings.Default.WarningAction = (FailAction)WarningComboBox.SelectedItem; diff -r 9e77c0dccb66 -r 75ca86e0862c ServerMonitor/Properties/Settings.Designer.cs --- a/ServerMonitor/Properties/Settings.Designer.cs Mon Apr 08 21:31:03 2019 -0400 +++ b/ServerMonitor/Properties/Settings.Designer.cs Mon Apr 15 19:24:25 2019 -0400 @@ -118,5 +118,17 @@ this["IgnoreUpdate"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool HideToNotificationArea { + get { + return ((bool)(this["HideToNotificationArea"])); + } + set { + this["HideToNotificationArea"] = value; + } + } } } diff -r 9e77c0dccb66 -r 75ca86e0862c ServerMonitor/Properties/Settings.settings --- a/ServerMonitor/Properties/Settings.settings Mon Apr 08 21:31:03 2019 -0400 +++ b/ServerMonitor/Properties/Settings.settings Mon Apr 15 19:24:25 2019 -0400 @@ -26,5 +26,8 @@ + + True + \ No newline at end of file