Ejemplo n.º 1
0
 public FileWatch(IFileChangedNotify watcher, string assetPath)
 {
     m_Watcher         = watcher;
     m_Path            = assetPath;
     pathHash          = ComputePathHash(assetPath);
     enabled           = false;
     needsNotification = false;
 }
Ejemplo n.º 2
0
        public void DisableWatcher(IFileChangedNotify watcher)
        {
            bool hasEnabled = false;

            foreach (var e in m_WatchedPaths)
            {
                if (e.watcher == watcher)
                {
                    e.enabled = false;
                }

                hasEnabled |= e.enabled;
            }

            m_FileWatcher.EnableRaisingEvents = hasEnabled;
        }
Ejemplo n.º 3
0
        public void RemoveAllFiles(IFileChangedNotify watcher)
        {
            m_WatchedPaths.RemoveAll(element => element.watcher == watcher);

            bool hasEnabled = false;

            foreach (var e in m_WatchedPaths)
            {
                if (e.enabled)
                {
                    hasEnabled = true;
                    break;
                }
            }

            m_FileWatcher.EnableRaisingEvents = hasEnabled;
        }
Ejemplo n.º 4
0
        public void AddFile(IFileChangedNotify watcher, string path)
        {
            if (watcher == null || path == null)
            {
                throw new ArgumentNullException();
            }

            if (path.Length == 0)
            {
                throw new ArgumentOutOfRangeException();
            }

            var entry = new FileWatch(watcher, path);

            if (!m_WatchedPaths.Contains(entry))
            {
                m_WatchedPaths.Add(entry);
            }
        }
Ejemplo n.º 5
0
 public void DisableWatcher(IFileChangedNotify watcher)
 {
     m_Implementation?.DisableWatcher(watcher);
 }
Ejemplo n.º 6
0
 public void RemoveAllFiles(IFileChangedNotify watcher)
 {
     m_Implementation?.RemoveAllFiles(watcher);
 }
Ejemplo n.º 7
0
 public void AddFile(IFileChangedNotify watcher, string path)
 {
     m_Implementation?.AddFile(watcher, path);
 }