public TimedAction(FsObject<RelPath> descriptor, TimerCallback callback, long dueTime, long period) { _descriptor = descriptor; _callback = callback; _dueTime = dueTime; _period = period; _tickTimer = new Timer(callback, this, dueTime, period); }
private FsObject[] Info(string[] paths) { FsObject[] data = new FsObject[paths.Length]; for (var i = 0; i < paths.Length; i++) { data[i] = _drive.Info(paths[i]); } return(data); }
private void FileMovedRenamed(FsObject<RelPath> sourceFile, FsObject<RelPath> targetFile) { if (SameGroup(sourceFile.Path, targetFile.Path)) { Console.WriteLine("File Moved or Renamed from: " + sourceFile.Path + " to: " + targetFile.Path); FileIndex.Remove(sourceFile); FileIndex.Add(targetFile); } else { FileDeleted(sourceFile); FileCreated(targetFile); } }
private void FileCreated(FsObject<RelPath> descriptor) { // string relPath = fileModule.Network.MainPath.CreateRelative(path); Console.WriteLine("Object Created: {0}", descriptor.Path); FileIndex.Add(descriptor); // try // { // FileOrFolder objectType = GetObjectType(path); // string relativePath = fileModule.Network.MainPath.CreateRelative(path); // var message = new SingleFileMessage(relativePath, objectType, SinglePathFileEvent.Created); // // var task = new FileCreatedFirstSideTask(fileModule, message); // } // catch (Exception e) // { // // Console.WriteLine(e); // } }
public TimedFolderDeletion(FsObject<RelPath> descriptor, TimerCallback callback, IndexedObjects indexedContent) : base(descriptor, callback, ChangeWatcher.DeleteWaitTime, Timeout.Infinite) { _indexedContent = indexedContent; }
public void AddObject(FsObject<RelPath> descriptor) { DirNode parent = GetParentDir(descriptor.Path); if (descriptor is FsFile<RelPath>) { var file = ((FsFile<RelPath>) descriptor).NewAsName(); parent.Files.Add(file.Path, file); } else { var dir = ((FsFolder<RelPath>)descriptor).NewAsName(); var node = new DirNode(dir, parent); parent.Directories.Add(dir.Path, node); } }
public bool TryGetObject(RelPath path, out FsObject<RelPath> fsObject) { throw new NotImplementedException(); }
public TimedNewFileTracking(FsObject<RelPath> descriptor, TimerCallback callback, long dueTile, long period) : base(descriptor, callback, dueTile, period) { }
private void FileReplaced(FsObject<RelPath> sourceObj, FsObject<RelPath> targetObj) { Console.WriteLine("File Replaced from: " + sourceObj.Path + " to: " + targetObj.Path); }
private void FileDeleted(FsObject<RelPath> storedDescr) { Console.WriteLine("File Deleted: " + storedDescr.Path); FileIndex.Remove(storedDescr); }