ToolBX.Collections.Caching
3.0.0
dotnet add package ToolBX.Collections.Caching --version 3.0.0
NuGet\Install-Package ToolBX.Collections.Caching -Version 3.0.0
<PackageReference Include="ToolBX.Collections.Caching" Version="3.0.0" />
paket add ToolBX.Collections.Caching --version 3.0.0
#r "nuget: ToolBX.Collections.Caching, 3.0.0"
// Install ToolBX.Collections.Caching as a Cake Addin #addin nuget:?package=ToolBX.Collections.Caching&version=3.0.0 // Install ToolBX.Collections.Caching as a Cake Tool #tool nuget:?package=ToolBX.Collections.Caching&version=3.0.0
Caching collections
Collections that are limited to a specified size in order to be used as object caches.
Observability
All collections in this package implement the IObservableCollection<T>
interface from ToolBX.Collections.Common.
var collection = new CachingDictionary<int, string>();
collections.CollectionChanged += DictionaryChanged;
Limit property
Limits the number of items allowed in the collection to this number. The oldest elements are removed first. If you wanted to limit your list to the 10 last elements, you would do this :
var collection = new CachingList<string>();
collection.Limit = 10;
This way, adding an eleventh element will remove the oldest so that your list always has a maximum of 10 elements.
TrimStartDownTo
Removes the x
oldest elements that were added to the collection.
//Removes the five oldest elements in the collection
collection.TrimStartDownTo(5);
TrimEndDownTo
Removes the x
newest elements that were added to the collection.
//Removes the eight newest elements in the collection
collection.TrimStartDownTo(8);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- ToolBX.Collections.ObservableDictionary (>= 3.0.0)
- ToolBX.Collections.ObservableList (>= 3.0.0)
- ToolBX.Collections.ObservableStack (>= 3.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ToolBX.Collections.Caching:
Package | Downloads |
---|---|
ToolBX.Collections.UnitTesting
Tester classes and extensions to help with unit testing ToolBX.Collections. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.0.0 | 162 | 9/27/2024 |
3.0.0-beta1 | 83 | 9/23/2024 |
2.2.0 | 159 | 1/13/2024 |
2.2.0-beta2 | 114 | 1/7/2024 |
2.2.0-beta1 | 104 | 1/4/2024 |
2.0.0 | 423 | 11/11/2022 |
2.0.0-beta2 | 191 | 10/3/2022 |
2.0.0-beta1 | 198 | 9/22/2022 |
1.0.1 | 462 | 7/15/2022 |
1.0.0 | 474 | 7/11/2022 |