public async Task UpdateOptions (Options options, GeneralOptions generalOptions)
{
if (options == null)
throw new ArgumentNullException (nameof (options));
if (generalOptions == null)
throw new ArgumentNullException (nameof (generalOptions));
_pendingOutlookItems.Clear();
_fullSyncPending = false;
_profileName = options.Name;
_profileId = options.Id;
_proxyOptions = options.ProxyOptions;
_synchronizer = options.Inactive ? NullOutlookSynchronizer.Instance : await _synchronizerFactory.CreateSynchronizer (options, generalOptions);
_interval = TimeSpan.FromMinutes (options.SynchronizationIntervalInMinutes);
_inactive = options.Inactive;
_checkIfOnline = generalOptions.CheckIfOnline;
if (_folderChangeWatcher != null)
{
_folderChangeWatcher.ItemSavedOrDeleted -= FolderChangeWatcher_ItemSavedOrDeleted;
_folderChangeWatcher.Dispose();
_folderChangeWatcher = null;
}
if (!_inactive && options.EnableChangeTriggeredSynchronization)
{
_folderChangeWatcher =
_folderChangeWatcherFactory.Create (options.OutlookFolderEntryId, options.OutlookFolderStoreId);
_folderChangeWatcher.ItemSavedOrDeleted += FolderChangeWatcher_ItemSavedOrDeleted;
}
}