private bool ShouldSend(FileSystemNotification fileSystemNotification)
        {
            if (fileSystemNotification is FileChangeNotification &&
                matchingFolders.Any(
                    f => ((FileChangeNotification)fileSystemNotification).File.StartsWith(f, StringComparison.InvariantCultureIgnoreCase)))
            {
                return true;
            }

            if (fileSystemNotification is ConfigurationChangeNotification && watchConfig > 0)
            {
                return true;
            }

            if (fileSystemNotification is ConflictNotification && watchConflicts > 0)
            {
                return true;
            }

            if (fileSystemNotification is SynchronizationUpdateNotification && watchSync > 0)
            {
                return true;
            }

            return false;
        }
        public void Send(FileSystemNotification fileSystemNotification)
        {
            if (ShouldSend(fileSystemNotification))
            {
                var value = new { Value = fileSystemNotification, Type = fileSystemNotification.GetType().Name };

                enqueue(value);
            }
        }
Exemple #3
0
 public void Send(FileSystemNotification fileSystemNotification)
 {
     OnFileSystemNotification(this, fileSystemNotification);
     foreach (var connectionState in connections)
     {
         if (fileSystemNotification is FileChangeNotification)
         {
         }
         connectionState.Value.FileSystem.Send(fileSystemNotification);
     }
 }
Exemple #4
0
 public void Publish(FileSystemNotification change)
 {
     transportState.Send(change);
 }