public void SetUpSync(IAppointmentSourceFactory source, IAppointmentDestinationFactory destination, TimeSpan interval) { lock (_stateLock) { if (!_paused) { throw new InvalidOperationException("Cannot set up until paused"); } _synchronizer = new CalendarSynchronizer(source, destination); _timerInterval = interval; Logger.Info($"Scheduled synchronization from {_synchronizer.SourceName} to {_synchronizer.DestinationName} every {interval}"); } }
public CalendarSynchronizer(IAppointmentSourceFactory sourceFactory, IAppointmentDestinationFactory destinationFactory) { _sourceFactory = sourceFactory; _destinationFactory = destinationFactory; }