/// <summary> /// This constructer is needed to instantiate an new SyncService with a given CalendarHandler, a remote connector and a sync interval. /// </summary> /// <param name="syncOutlook">The Outlook calendar handler to use for sync operations.</param> /// <param name="syncExternal">The remote connector to use for sync operations.</param> /// <param name="interval">The interval to use for auto sync.</param> public SyncService(CalendarHandler syncOutlook, ICalendarSyncable syncExternal, double interval) { this._syncOutlook = syncOutlook; this._syncExternal = syncExternal; SetInterval(interval); _syncThread.Elapsed += _syncThread_Elapsed; }
/// <summary> /// Instantiates and gets everything needed for the sync /// </summary> public void InitializeSync() { if (_config.calendarName != null) { _connHandler.ChooseConnector(_config.connector); _connHandler.Settings = new ConnectorSettings(_config.userName, _confManager.GetPassword(), _config.URL); _calHandler = new CalendarHandler(Globals.ThisAddIn.Application, _config.calendarName); _synService = new SyncService(_calHandler, _connHandler, _config.updateInterval); init = true; } }