private OutlookSynchronizer CreateEventSynchronizer (Options options) { var calDavDataAccess = new CalDavDataAccess ( new Uri (options.CalenderUrl), CreateWebDavClient (options, _calDavConnectTimeout)); var storageDataDirectory = _profileDataDirectoryFactory (options.Id); var entityRelationDataAccess = new EntityRelationDataAccess<string, DateTime, OutlookEventRelationData, Uri, string> (storageDataDirectory); return CreateEventSynchronizer (options, calDavDataAccess, entityRelationDataAccess); }
private OutlookSynchronizer CreateContactSynchronizer (Options options) { var atypeRepository = new OutlookContactRepository ( _outlookSession, options.OutlookFolderEntryId, options.OutlookFolderStoreId); IEntityRepository<vCard, Uri, string> btypeRepository = new CardDavRepository ( new CardDavDataAccess ( new Uri (options.CalenderUrl), CreateWebDavClient ( options.UserName, options.Password, _calDavConnectTimeout, options.ServerAdapterType, options.CloseAfterEachRequest, options.ProxyOptions))); var entityRelationDataFactory = new OutlookContactRelationDataFactory(); var syncStateFactory = new EntitySyncStateFactory<string, DateTime, ContactItemWrapper, Uri, string, vCard> ( new ContactEntityMapper(), atypeRepository, btypeRepository, entityRelationDataFactory, ExceptionHandler.Instance); var btypeIdEqualityComparer = EqualityComparer<Uri>.Default; var atypeIdEqulityComparer = EqualityComparer<string>.Default; var storageDataDirectory = _profileDataDirectoryFactory (options.Id); var storageDataAccess = new EntityRelationDataAccess<string, DateTime, OutlookContactRelationData, Uri, string> (storageDataDirectory); var synchronizer = new Synchronizer<string, DateTime, ContactItemWrapper, Uri, string, vCard> ( atypeRepository, btypeRepository, InitialContactSyncStateCreationStrategyFactory.Create ( syncStateFactory, syncStateFactory.Environment, options.SynchronizationMode, options.ConflictResolution), storageDataAccess, entityRelationDataFactory, new InitialContactEntityMatcher (btypeIdEqualityComparer), atypeIdEqulityComparer, btypeIdEqualityComparer, _totalProgressFactory, ExceptionHandler.Instance); return new OutlookSynchronizer (synchronizer, atypeRepository); }
private ISynchronizer CreateEventSynchronizer(Options options) { var storageDataDirectory = Path.Combine ( _applicationDataDirectory, options.Id.ToString() ); var storageDataAccess = new EntityRelationDataAccess<string, DateTime, OutlookEventRelationData, Uri, string> (storageDataDirectory); var btypeIdEqualityComparer = EqualityComparer<Uri>.Default; var atypeIdComparer = EqualityComparer<string>.Default; var synchronizationContext = new EventSynchronizationContext ( _outlookSession, storageDataAccess, options, _outlookEmailAddress, TimeSpan.Parse (ConfigurationManager.AppSettings["calDavConnectTimeout"]), TimeSpan.Parse (ConfigurationManager.AppSettings["calDavReadWriteTimeout"]), Boolean.Parse (ConfigurationManager.AppSettings["disableCertificateValidation"]), Boolean.Parse (ConfigurationManager.AppSettings["enableSsl3"]), Boolean.Parse (ConfigurationManager.AppSettings["enableTls12"]), btypeIdEqualityComparer); var syncStateFactory = new EntitySyncStateFactory<string, DateTime, AppointmentItemWrapper, Uri, string, IICalendar> ( synchronizationContext.EntityMapper, synchronizationContext.AtypeRepository, synchronizationContext.BtypeRepository, synchronizationContext.EntityRelationDataFactory, ExceptionHandler.Instance ); return new Synchronizer<string, DateTime, AppointmentItemWrapper, Uri, string, IICalendar> ( synchronizationContext, InitialEventSyncStateCreationStrategyFactory.Create ( syncStateFactory, syncStateFactory.Environment, options.SynchronizationMode, options.ConflictResolution), _totalProgressFactory, atypeIdComparer, btypeIdEqualityComparer, ExceptionHandler.Instance); }
private ISynchronizer CreateEventSynchronizer (Options options) { var calDavDataAccess = CreateCalDavDataAccess ( options.CalenderUrl, options.UserName, options.Password, _calDavConnectTimeout, options.ServerAdapterType); var storageDataDirectory = Path.Combine ( _applicationDataDirectory, options.Id.ToString() ); var entityRelationDataAccess = new EntityRelationDataAccess<string, DateTime, OutlookEventRelationData, Uri, string> (storageDataDirectory); return CreateEventSynchronizer (options, calDavDataAccess, entityRelationDataAccess); }
private ISynchronizer CreateContactSynchronizer (Options options) { var atypeRepository = new OutlookContactRepository ( _outlookSession, options.OutlookFolderEntryId, options.OutlookFolderStoreId); IEntityRepository<vCard, Uri, string> btypeRepository = new CardDavRepository ( CreateCardDavDataAccess ( options.CalenderUrl, options.UserName, options.Password, _calDavConnectTimeout, options.ServerAdapterType)); var entityRelationDataFactory = new OutlookContactRelationDataFactory(); var syncStateFactory = new EntitySyncStateFactory<string, DateTime, GenericComObjectWrapper<ContactItem>, Uri, string, vCard> ( new ContactEntityMapper(), atypeRepository, btypeRepository, entityRelationDataFactory, ExceptionHandler.Instance); var btypeIdEqualityComparer = EqualityComparer<Uri>.Default; var atypeIdEqulityComparer = EqualityComparer<string>.Default; var storageDataDirectory = Path.Combine ( _applicationDataDirectory, options.Id.ToString() ); var storageDataAccess = new EntityRelationDataAccess<string, DateTime, OutlookContactRelationData, Uri, string> (storageDataDirectory); return new Synchronizer<string, DateTime, GenericComObjectWrapper<ContactItem>, Uri, string, vCard> ( atypeRepository, btypeRepository, InitialContactSyncStateCreationStrategyFactory.Create ( syncStateFactory, syncStateFactory.Environment, options.SynchronizationMode, options.ConflictResolution), storageDataAccess, entityRelationDataFactory, new InitialContactEntityMatcher (btypeIdEqualityComparer), atypeIdEqulityComparer, btypeIdEqualityComparer, _totalProgressFactory, ExceptionHandler.Instance); }
private ISynchronizer CreateEventSynchronizer (Options options) { var calDavDataAccess = new CalDavDataAccess ( new Uri (options.CalenderUrl), CreateWebDavClient (options, _calDavConnectTimeout)); var storageDataDirectory = Path.Combine ( _applicationDataDirectory, options.Id.ToString() ); var entityRelationDataAccess = new EntityRelationDataAccess<string, DateTime, OutlookEventRelationData, Uri, string> (storageDataDirectory); return CreateEventSynchronizer (options, calDavDataAccess, entityRelationDataAccess); }