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;
            }
        }
Example #2
0
        private void SyncRibbon_Load(object sender, RibbonUIEventArgs e)
        {
            _confManager    = new ConfigurationManager();
            _config         = _confManager.GetConfig();
            _syncController = new SyncController(_confManager);

            if (_config.autosync == 1)
            {
                _syncController.InitializeAutoSync();
                btn_autosync.Label = "Deactivate";
            }
            else
            {
                _syncController.InitializeSync();
            }

            updateInterval    = (_confManager.GetUpdateInterval() / 1000);
            edb_interval.Text = updateInterval.ToString();
        }