예제 #1
0
 public DpLocalStorage(IFileSystemWorker fileSystemWorker)
 {  
     _fileSystemWorker = fileSystemWorker;
     LocalStorageCache = new Dictionary<string, LocalStorageItem>();
     _localDirectory = Path.Combine(_fileSystemWorker.GetWorkshareTempPath(true), "WdLocalStorage");
     EnsureLocalStorageFolderExists();
 }
예제 #2
0
 public DocumentProviderImpl(IModule module, IWdDocumentRepository wdDocRepo, DPCache dpCache, DPSessionManager sessionFactory, IDPConfigurator configurator, 
     IProcessLauncher processLauncher, IFileSystemWorker fileSystemWorker, IDpLocalStorage localStorage, IWsMessage message, WdLocator locator)
 {
     _module = module;
     _wdDocRepo = wdDocRepo;
     _dpCache = dpCache;
     _sessionManager = sessionFactory;
     _dialogConfigurator = configurator;
     _processLauncher = processLauncher;
     _fileSystemWorker = fileSystemWorker;
     _localStorage = localStorage;
     _message = message;
     _isWorldoxInstalled = !string.IsNullOrEmpty(locator.NetworkWorldoxDirectory());
 }
예제 #3
0
        public FileListener(IDirectoryWorker directoryWorker, string defaultDestinationDirectoryPath, IFileSystemWorker fileSystemWorker)
        {
            this.directoryWorker = directoryWorker ?? throw new ArgumentNullException();
            this.defaultDestinationDirectoryPath = defaultDestinationDirectoryPath ?? throw new ArgumentNullException();
            this.fileSystemWorker = fileSystemWorker ?? throw new ArgumentNullException();

            if (directoryWorker.Path == null)
            {
                throw new ArgumentNullException();
            }

            if (!this.fileSystemWorker.IsDirectoryExists(directoryWorker.Path))
            {
                throw new ArgumentOutOfRangeException();
            }

            directoryWorker.Created += OnCreated;
            generateNewFileName      = fileRelocationInfo => fileRelocationInfo.FileName;
            rules = new Dictionary <Regex, string>();
        }
예제 #4
0
        public void Init()
        {
            fileSystemWorkerMock = MockRepository.GenerateMock <IFileSystemWorker>();
            directoryWorkerMock  = MockRepository.GenerateMock <IDirectoryWorker>();
            directoryWorkerMock.Stub(x => x.Path).Return(directoryToWatchPath);
            existingDirectoryPaths = new List <string>
            {
                $"{directoryToWatchPath}",
                $"{directoryToWatchPath}/{firstLevelFolderName}"
            };

            filesToAddNames = new List <string>
            {
                "a.txt",
                "b1.txt",
                "c2.txt"
            };

            foreach (var directoryPath in existingDirectoryPaths)
            {
                fileSystemWorkerMock.Stub(provider => provider.IsDirectoryExists(directoryPath)).Return(true);
            }
        }
예제 #5
0
 public DPCache(IFileSystemWorker fileWorker)
 {
     _fileWorker = fileWorker;
     InitializeCache();
 }