void DisplaySettings(bool open, KopsikApi.KopsikSettingsViewItem settings)
 {
     if (InvokeRequired)
     {
         Invoke((MethodInvoker) delegate { DisplaySettings(open, settings); });
         return;
     }
     mustSaveProxySettings = false;
     mustSaveSettings      = false;
     loading = true;
     try
     {
         groupBoxProxySettings.Enabled     = settings.UseProxy;
         checkBoxUseProxy.Checked          = settings.UseProxy;
         textBoxProxyHost.Text             = settings.ProxyHost;
         textBoxProxyPort.Text             = settings.ProxyPort.ToString();
         textBoxProxyUsername.Text         = settings.ProxyUsername;
         textBoxProxyPassword.Text         = settings.ProxyPassword;
         checkBoxIdleDetection.Checked     = settings.UseIdleDetection;
         checkBoxRecordTimeline.Checked    = settings.RecordTimeline;
         checkBoxOnTop.Checked             = settings.OnTop;
         checkBoxRemindToTrackTime.Checked = settings.Reminder;
         checkBoxIgnoreCert.Checked        = settings.IgnoreCert;
     }
     finally
     {
         loading = false;
     }
     if (open)
     {
         Show();
         BringToFront();
     }
 }
 void DisplaySettings(KopsikApi.KopsikSettingsViewItem view)
 {
     if (InvokeRequired)
     {
         Invoke((MethodInvoker) delegate { DisplaySettings(view); });
         return;
     }
     this.TopMost = view.OnTop;
     timerIdleDetection.Enabled = view.UseIdleDetection;
 }
 void OnSettings(bool open,
                 ref KopsikApi.KopsikSettingsViewItem settings)
 {
     KopsikApi.KopsikSettingsViewItem view = settings;
     DisplaySettings(view);
 }
 void OnSettings(bool open, ref KopsikApi.KopsikSettingsViewItem settings)
 {
     KopsikApi.KopsikSettingsViewItem copy = settings;
     DisplaySettings(open, copy);
 }