Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
        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);
            //            }
        }
Ejemplo n.º 5
0
 public TimedFolderDeletion(FsObject<RelPath> descriptor, TimerCallback callback, IndexedObjects indexedContent)
     : base(descriptor, callback, ChangeWatcher.DeleteWaitTime, Timeout.Infinite)
 {
     _indexedContent = indexedContent;
 }
Ejemplo n.º 6
0
        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);
            }
        }
Ejemplo n.º 7
0
 public bool TryGetObject(RelPath path, out FsObject<RelPath> fsObject)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 8
0
 public TimedNewFileTracking(FsObject<RelPath> descriptor, TimerCallback callback, long dueTile, long period)
     : base(descriptor, callback, dueTile, period)
 {
 }
Ejemplo n.º 9
0
 private void FileReplaced(FsObject<RelPath> sourceObj, FsObject<RelPath> targetObj)
 {
     Console.WriteLine("File Replaced from: " + sourceObj.Path + " to: " + targetObj.Path);
 }
Ejemplo n.º 10
0
 private void FileDeleted(FsObject<RelPath> storedDescr)
 {
     Console.WriteLine("File Deleted: " + storedDescr.Path);
     FileIndex.Remove(storedDescr);
 }