Exemple #1
0
        private SyncEngine()
        {
            status      = "Idle";
            this.server = Const <BackupServiceClient> .Instance().get();

            String dirPath = conf.targetPath.get();

            threadCallback       = new ThreadStatus(this.ThreadMonitor);
            watcher              = new FileSystemWatcher();
            watcher.NotifyFilter = NotifyFilters.Size | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName;
            // Add event handlers.
            watcher.Changed += new FileSystemEventHandler(OnChanged);
            watcher.Created += new FileSystemEventHandler(OnChanged);
            watcher.Deleted += new FileSystemEventHandler(OnChanged);
            watcher.Renamed += new RenamedEventHandler(OnChanged);
            watcher.IncludeSubdirectories = true;
            watcher.Path = dirPath;
            // Begin watching.
            watcher.EnableRaisingEvents = true;
            vb = new FBVersionBuilder(dirPath);
        }