You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
internalconststringROLLOVER_TIME_PROFILENAME="Rollover Time";publicstaticDateTimeROLLOVER_TIME_DEFAULT=DateTime.Now.Date;// Default value can't be const because it's a date-time type
149
149
internalconststringUSE_UTC_TIME_IN_LOGS_PROFILENAME="Use UTC Time In Logs";publicconstboolUSE_UTC_TIME_IN_LOGS_ENABLED_DEFAULT=false;
150
+
internalconststringMINIMISE_TO_SYSTEM_TRAY_PROFILENAME="Minimise To System Tray";publicconstboolMINIMISE_TO_SYSTEM_TRAY_DEFAULT=false;
@@ -252,6 +258,8 @@ public partial class ServerForm : Form
252
258
internalstaticboolRolloverLogsEnabled;
253
259
internalstaticDateTimeRolloverTime;
254
260
internalstaticboolUseUtcTimeInLogs;
261
+
internalstaticboolMinimiseToSystemTray;
262
+
internalstaticboolConfirmExit;
255
263
256
264
#endregion
257
265
@@ -274,6 +282,7 @@ public partial class ServerForm : Form
274
282
275
283
privatestaticreadonlyobjectlogLockObject=newobject();// Lock object to ensure that midnight log change overs happen smoothly
276
284
privatestaticTraceLoggerPlusTL;// Variable to hold the trace logger
285
+
privatestaticFormWindowStateformWindowState;// Holds the server form window state in use before the application is minimised to the system tray so that this state can be restored when required
277
286
278
287
#endregion
279
288
@@ -344,6 +353,10 @@ public ServerForm()
344
353
this.MinimumSize=newSize(FORM_MINIMUM_WIDTH,FORM_MINIMUM_HEIGHT);// Set the form's minimum size
// Check whether the server is configured to ask for shutdown confirmation
437
+
if(ConfirmExit)// Confirmation is required
438
+
{
439
+
// Ask the user whether they want to close the remote server
440
+
DialogResultresult=MessageBox.Show("Are you sure you want to close the Remote Server?","ASCOM Remote Server",MessageBoxButtons.OKCancel,MessageBoxIcon.Warning);
441
+
442
+
// An OK result means the user wants to shut down the Remote Server so close the server form, otherwise do nothing
443
+
if(result==DialogResult.OK)
444
+
this.Close();
445
+
}
446
+
else// No confirmation is required so go ahead and shut down the application.
447
+
{
448
+
this.Close();
449
+
}
450
+
}
451
+
418
452
privateuintGetServerTransactionID()
419
453
{
420
454
// Increment the server transaction number in a thread safe way
@@ -1498,6 +1532,8 @@ public static void ReadProfile()
if(request.HttpMethod.ToUpperInvariant()=="OPTIONS")// This is a CORS pre-flight request so we need to set some specific headers
2198
2308
{
2199
2309
// Set the Access-Control-Allow-Methods and Access-Control-Max-Age headers
2200
-
if(DebugTraceState)LogMessage1(requestData,SharedConstants.REQUEST_RECEIVED_STRING,$"OPTIONS method found - This is a CORS PRE_FLIGHT request: {CORS_ALLOWED_METHODS_HEADER} = {CORS_ALLOWED_METHODS}, {CORS_MAX_AGE_HEADER} = {CorsMaxAge}");
2310
+
if(DebugTraceState)LogMessage1(requestData,SharedConstants.REQUEST_RECEIVED_STRING,$"OPTIONS method found - This is a CORS PRE_FLIGHT request: {CORS_ALLOWED_METHODS_HEADER} = {CORS_ALLOWED_METHODS}, {CORS_MAX_AGE_HEADER} = {CorsMaxAge}");
0 commit comments