ZeroInstall.Store.Icons.DiskIconCache.Remove C# (CSharp) Method

Remove() public method

public Remove ( Uri iconUrl ) : void
iconUrl System.Uri
return void
        public void Remove(Uri iconUrl)
        {
            #region Sanity checks
            if (iconUrl == null) throw new ArgumentNullException(nameof(iconUrl));
            #endregion

            string path = Path.Combine(DirectoryPath, new FeedUri(iconUrl).Escape());

            lock (_lock)
            {
                File.Delete(path);
            }
        }
    }

Usage Example

Beispiel #1
0
 public void TestRemove()
 {
     _cache.Remove(new Uri("http://0install.de/feeds/images/test1.png"));
     _cache.Contains(new Uri("http://0install.de/feeds/images/test1.png")).Should().BeFalse();
     _cache.Contains(new Uri("http://0install.de/feeds/images/test2.png")).Should().BeTrue();
 }
All Usage Examples Of ZeroInstall.Store.Icons.DiskIconCache::Remove