private void SetSyncCommandEnabledIfConfigValid() { var syncConfig = SyncConfig.CreateFromFile(); ConfigValidCheckResult validConfig = ValidateConfigCreateMissingConfigMessage(syncConfig); contextMenuStrip1.Items["syncNowToolStripMenuItem"].Enabled = (validConfig.HasValidConfig); }
/// <summary> /// Set up this form for display for the user. Load config from disk and display to form elements. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FormOptions_Load(object sender, EventArgs e) { lblMsg.Text = string.Empty; var syncConfig = SyncConfig.CreateFromFile(); if (syncConfig != null) { WriteConfigToForm(syncConfig); } }
private SyncConfig LoadSyncConfig() { var syncConfig = SyncConfig.CreateFromFile(); ConfigValidCheckResult validConfig = ValidateConfigCreateMissingConfigMessage(syncConfig); if (validConfig.HasValidConfig == false) { ShowBalloon(validConfig.Message); optionsToolStripMenuItem_Click(null, null); return(null); } return(syncConfig); }