示例#1
0
 public SynchronizationThread(NoteRepository repository, ISynchronizationFeedback[] synclistener, ConflictResolutionStrategyConfig strat, IAlephDispatcher disp)
 {
     repo             = repository;
     listener         = synclistener.ToList();
     conflictStrategy = ConflictResolutionStrategyHelper.ToInterfaceType(strat);
     dispatcher       = disp;
     _comChannel      = new ManualResetEvent(false);
 }
        public SynchronizationThread(NoteRepository repository, IEnumerable <ISynchronizationFeedback> synclistener, AppSettings settings, IAlephDispatcher disp)
        {
            _repo     = repository;
            _listener = synclistener.ToList();

            _conflictStrategy = ConflictResolutionStrategyHelper.ToInterfaceType(settings.ConflictResolution);
            _noteDownloadEnableMultithreading    = repository.SupportsDownloadMultithreading;
            _noteDownloadParallelismLevel        = settings.NoteDownloadParallelismLevel;
            _noteDownloadParallelismThreshold    = settings.NoteDownloadParallelismThreshold;
            _noteNewDownloadEnableMultithreading = repository.SupportsNewDownloadMultithreading;
            _noteNewDownloadParallelismLevel     = settings.NoteNewDownloadParallelismLevel;
            _noteNewDownloadParallelismThreshold = settings.NoteNewDownloadParallelismThreshold;
            _noteUploadEnableMultithreading      = repository.SupportsUploadMultithreading;
            _noteUploadParallelismLevel          = settings.NoteUploadParallelismLevel;
            _noteUploadParallelismThreshold      = settings.NoteUploadParallelismThreshold;

            _dispatcher = disp;
            _comChannel = new ManualResetEvent(false);
        }