Example #1
0
        public LocalFolderLink(string encryptedFolder, string decryptedFolder, PersonalCard personalCard, string privateKeyPassword)
        {
            this.personalCard       = personalCard;
            this.privateKeyPassword = privateKeyPassword;
            this.encryptedFolder    = new LocalFolder(new LocalFolderRoot(encryptedFolder), "Encrypted");
            this.decryptedFolder    = new LocalFolder(new LocalFolderRoot(decryptedFolder), "Decrypted");

            this.encryptedFolder.Subscribe(this);
            this.decryptedFolder.Subscribe(this);

            this.encryptedFolderWatcher = new LocalFolderWatcher(this.encryptedFolder);
            this.decryptedFolderWatcher = new LocalFolderWatcher(this.decryptedFolder);

            this.cancellationTokenSource = new CancellationTokenSource();
        }
Example #2
0
 public LocalFolderWatcher(LocalFolder folder)
 {
     this.folder            = folder;
     this.fileSystemWatcher = new FileSystemWatcher(folder.Root.Value)
     {
         IncludeSubdirectories = true,
         InternalBufferSize    = 1024 * 64,
         NotifyFilter          = NotifyFilters.FileName |
                                 NotifyFilters.DirectoryName |
                                 NotifyFilters.Attributes |
                                 NotifyFilters.Size |
                                 NotifyFilters.LastWrite |
                                 NotifyFilters.LastAccess |
                                 NotifyFilters.CreationTime
     };
 }