comparison ServerMonitor/Forms/ServerSummaryForm.cs @ 11:75ca86e0862c

Add setting to hide to notification area.
author Brad Greco <brad@bgreco.net>
date Mon, 15 Apr 2019 19:24:25 -0400
parents 9e77c0dccb66
children 7626b099aefd
comparison
equal deleted inserted replaced
10:9e77c0dccb66 11:75ca86e0862c
190 ShowServerForm(null); 190 ShowServerForm(null);
191 } 191 }
192 192
193 private void ServerSummaryForm_FormClosing(object sender, FormClosingEventArgs e) 193 private void ServerSummaryForm_FormClosing(object sender, FormClosingEventArgs e)
194 { 194 {
195 if (e.CloseReason == CloseReason.None || e.CloseReason == CloseReason.UserClosing) 195 if ((e.CloseReason == CloseReason.None || e.CloseReason == CloseReason.UserClosing) && Settings.Default.HideToNotificationArea)
196 { 196 {
197 Hide(); 197 Hide();
198 e.Cancel = true; 198 e.Cancel = true;
199 } 199 }
200 } 200 }
295 private void CheckForUpdate() 295 private void CheckForUpdate()
296 { 296 {
297 //System.Threading.Thread.Sleep(5000); 297 //System.Threading.Thread.Sleep(5000);
298 UpdateManager manager = UpdateManager.Instance; 298 UpdateManager manager = UpdateManager.Instance;
299 manager.ReinstateIfRestarted(); 299 manager.ReinstateIfRestarted();
300 manager.UpdateSource = new SimpleWebSource(@"c:\temp\feed.xml"); 300 manager.UpdateSource = new SimpleWebSource("https://www.bgreco.net/test/servermonitor.xml");
301 if (manager.State == UpdateManager.UpdateProcessState.NotChecked) 301 if (manager.State == UpdateManager.UpdateProcessState.NotChecked)
302 manager.BeginCheckForUpdates(CheckForUpdatesCallback, null); 302 manager.BeginCheckForUpdates(CheckForUpdatesCallback, null);
303 } 303 }
304 304
305 private void CheckForUpdatesCallback(IAsyncResult result) 305 private void CheckForUpdatesCallback(IAsyncResult result)