public void RemoveWatcher(ICacheWatcher watcher)
        {
            // Remove the watcher.
            _watchers.Remove(watcher);

            // If there are no more watchers, remove this from the cache list.
            if (_watchers.Count == 0)
            {
                Cache.RemoveElement(this);
            }
        }
Beispiel #2
0
 public static T FromFile(ICacheWatcher watcher, string file, Func <Uri, T> makeFile) => FromUri(watcher, new Uri(file), makeFile);
Beispiel #3
0
 public static T FromUri(ICacheWatcher watcher, Uri uri, Func <Uri, T> makeFile) => watcher.Get <T>(new FileIdentifier <T>(uri, makeFile));
 public void AddWatcher(ICacheWatcher watcher) => _watchers.Add(watcher);