public HealthCheckSettingsDialog(Pool pool, bool enrollNow)
 {
     this.pool = pool;
     healthCheckSettings = pool.HealthCheckSettings;
     if (enrollNow)
         healthCheckSettings.Status = HealthCheckStatus.Enabled;
     authenticationToken = healthCheckSettings.GetExistingSecretyInfo(pool.Connection, HealthCheckSettings.UPLOAD_TOKEN_SECRET);
     xsUserName = healthCheckSettings.GetSecretyInfo(pool.Connection, HealthCheckSettings.UPLOAD_CREDENTIAL_USER_SECRET);
     xsPassword = healthCheckSettings.GetSecretyInfo(pool.Connection, HealthCheckSettings.UPLOAD_CREDENTIAL_PASSWORD_SECRET);
     InitializeComponent();
     PopulateControls();
     InitializeControls();
     UpdateButtons();
 }
 public HealthCheckSettingsDialog(Pool pool, bool enrollNow)
 {
     this.pool           = pool;
     healthCheckSettings = pool.HealthCheckSettings;
     if (enrollNow)
     {
         healthCheckSettings.Status = HealthCheckStatus.Enabled;
     }
     authenticated          = healthCheckSettings.TryGetExistingTokens(pool.Connection, out authenticationToken, out diagnosticToken);
     authenticationRequired = !authenticated;
     xsUserName             = healthCheckSettings.GetSecretyInfo(pool.Connection, HealthCheckSettings.UPLOAD_CREDENTIAL_USER_SECRET);
     xsPassword             = healthCheckSettings.GetSecretyInfo(pool.Connection, HealthCheckSettings.UPLOAD_CREDENTIAL_PASSWORD_SECRET);
     InitializeComponent();
     PopulateControls();
     InitializeControls();
     UpdateButtons();
 }
 private bool ChangesMade()
 {
     if (enrollmentCheckBox.Checked && healthCheckSettings.Status != HealthCheckStatus.Enabled)
     {
         return(true);
     }
     if (!enrollmentCheckBox.Checked && healthCheckSettings.Status != HealthCheckStatus.Disabled)
     {
         return(true);
     }
     if (frequencyNumericBox.Value != healthCheckSettings.IntervalInWeeks)
     {
         return(true);
     }
     if (dayOfWeekComboBox.SelectedIndex != (int)healthCheckSettings.DayOfWeek)
     {
         return(true);
     }
     if (timeOfDayComboBox.SelectedIndex != healthCheckSettings.TimeOfDay)
     {
         return(true);
     }
     if (authenticationToken != healthCheckSettings.GetSecretyInfo(pool.Connection, HealthCheckSettings.UPLOAD_TOKEN_SECRET))
     {
         return(true);
     }
     if (textboxXSUserName.Text != xsUserName)
     {
         return(true);
     }
     if (textboxXSPassword.Text != xsPassword)
     {
         return(true);
     }
     return(false);
 }