public ConfigManagerUI(ConfigurationManager _configManager, SyncController _syncController) { InitializeComponent(); confManager = _configManager; conf = confManager.GetConfig(); syncController = _syncController; if (syncController.GetAutosync() == true) { syncController.StopSync(); } availableConnectors = conHan.GetAvailableConnectors(); foreach (var item in availableConnectors) { cbo_Connector.Items.Add(item); } if (conf != null) { userName = conf.userName; synced = conf.synced; txt_Username.Text = userName; calendarName = conf.calendarName; txt_CalendarName.Text = calendarName; connector = conf.connector; cbo_Connector.SelectedIndex = cbo_Connector.FindStringExact(connector); URL = conf.URL; txt_URL.Text = URL; password = confManager.GetPassword(); txt_Password.Text = password; } }
private void btn_autosync_Click(object sender, RibbonControlEventArgs e) { if (_syncController.GetAutosync() == false) { if (_config.calendarName != null) { btn_autosync.Label = "Deactivate"; _confManager.SetAutoSync(1); } _syncController.InitializeAutoSync(); } else if (_syncController.GetAutosync() == true) { _confManager.SetAutoSync(0); _syncController.StopSync(); btn_autosync.Label = "Activate"; } }