Skip to content

Releases: Moreault/Collections

3.0.0

27 Sep 14:01
4d8ea6b
Compare
Choose a tag to compare

Collections.ObservableList

New

  • An Overwrite method has been added which clears the list and adds new entries instead. This is the equivalent of using Clear followed by Add and will not trigger an event if the operation does not change the state of the collection while Clear + Add would trigger twice regardless
  • Reverse methods from .NET's List<T> have been added

Breaking

  • The following methods and their overloads have been removed but are still available as part of ToolBX.OPEX : FirstIndexOf, LastIndexOf, IndexesOf, GetRandom, GetRandomIndex
  • The Add(System.Object) method has been removed
  • ObservableList no longer supports XML serialization

Other

  • Shuffle and Swap were erroneously [Obsolete] and were not removed

Collections.Grid

Potentially breaking

  • The Copy methods now return IGrid<T> only if you're using an IGrid<T> and Grid<T> if you're using Grid<T>

3.0.0-beta1

23 Sep 18:17
Compare
Choose a tag to compare
3.0.0-beta1 Pre-release
Pre-release
Updated nugets

2.2.0

13 Jan 14:35
142d0da
Compare
Choose a tag to compare

What's new

  • Updated ToolBX.OPEX to version 2.2.0
  • Updated ToolBX.Mathemancy to version 2.2.1
  • Updated ToolBX.OutWarden to version 2.2.0
  • Updated ToolBX.Reflection4Humans.Extensions to version 2.2.0

Caching

  • CachingDictionary now throws ArgumentNullException when Remove and TryRemove are used with a null IEnumerable<TKey>
  • CachingDictionary.TryGetValue now returns a Result<T> instead of a TryGetResult<T>
  • CachingDictionary can now be compared to a ObservableDictionary
  • == and != operators were added to CachingDictionary
  • Added a ToCachingDictionary extension method that takes a IEnumerable<KeyValuePair<TKey, TValue>>, making it easier to convert another dictionary type to a CachingDictionary
  • CachingStack now implements the CopyTo method
  • CachingStack.TryPeek now returns a Result<T> instead of a TryGetResult<T>
  • CachingStack.TryPop now returns a Result<T> instead of a TryGetResult<T>
  • == and != operators were added to CachingStack
  • Added System.Text.Json support to CachingDictionary but must be done manually by adding new CachingDictionaryJsonConverterFactory() to JsonSerializerOptions or use the options.WithCachingConverters() extension method
  • Added System.Text.Json support to CachingList but must be done manually by adding new CachingListJsonConverterFactory() to JsonSerializerOptions or use the options.WithCachingConverters() extension method
  • Added System.Text.Json support to CachingStack but must be done manually by adding new CachingStackJsonConverterFactory() to JsonSerializerOptions or use the options.WithCachingConverters() extension method

Common

  • CollectionChangeEventArgs<T> no longer inherits EventArgs and is now a record type

Grid

  • GridChangedEventArgs<T> implements proper value equality and hashcode
  • Added System.Text.Json support to Grid<T> but must be done manually by adding new GridJsonConverterFactory() to JsonSerializerOptions or use the options.WithGridConverters() extension method
  • Added System.Text.Json support to OverlapGrid<T> but must be done manually by adding new OverlapGridJsonConverterFactory() to JsonSerializerOptions or use the options.WithGridConverters() extension method
  • Fixed a potential issue with OverlapGrid<T>'s Equals method erroneously taking internal collection ordering by taking advantage of ToolBX.OPEX's new UnorderedEqualOrNull extension method

Inventory

  • Entry<T> is now sealed and inherits a new EntryBase<T>
  • GroupedEntry<T> is now sealed and inherits a new EntryBase<T>
  • IndexedEntry<T> is now sealed and inherits a new EntryBase<T>
  • GroupedEntry<T> now correctly implements value equality and hash code
  • GroupedEntry<T> has a new ToString override which returns its indexes in addition to the Item and Quantity
  • Inventory<T> no longer uses its Stack property for its hashcode since Stack is mutable
  • Added System.Text.Json support to InventoryList<T> but must be done manually by adding new InventoryListJsonConverterFactory() to JsonSerializerOptions or use the options.WithInventoryConverters() extension method
  • Added System.Text.Json support to InventoryTable<T> but must be done manually by adding new InventoryTableJsonConverterFactory() to JsonSerializerOptions or use the options.WithInventoryConverters() extension method
  • Added System.Text.Json support to StockSearchResult<T> but must be done manually by adding new StockSearchResultJsonConverterFactory() to JsonSerializerOptions or use the options.WithInventoryConverters() extension method
  • Fixed an issue with StockSearchResult<T> that incorrectly grouped items

ObservableDictionary

  • Added System.Text.Json support to ObservableDictionary<TKey, TValue> but must be done manually by adding new ObservableDictionaryJsonConverterFactory() to JsonSerializerOptions or use the options.WithObservableDictionaryConverters() extension method
  • The TryGetValue method now returns Result<T> instead of TryGetResult<T>

ObservableList

  • Added System.Text.Json support to ObservableList<T> but must be done manually by adding new ObservableListJsonConverterFactory() to JsonSerializerOptions or use the options.WithObservableListConverters() extension method

ObservableStack

  • Added System.Text.Json support to ObservableStack<T> but must be done manually by adding new ObservableStackJsonConverterFactory() to JsonSerializerOptions or use the options.WithObservableListConverters() extension method
  • The TryPeek method now returns Result<T> instead of TryGetResult<T>
  • The TryPop method now returns Result<T> instead of TryGetResult<T>

ReadOnly

  • You can now instantiate a new ReadOnlyList<T> with ReadOnlyList.Create(1, 2, 3) as you would with the official System.Collections.Immutable.ImmutableList<T> but ReadOnlyList<T>'s constructor is still supported
  • Added System.Text.Json support but must be done manually by adding new ReadOnlyListJsonConverterFactory() to JsonSerializerOptions or use the options.WithReadOnlyConverters() extension method
  • Newtonsoft.Json is still supported by default (no custom converter required)
  • ReadOnlyList<T> now has proper value-based hashcode
  • The ToReadOnlyList<T>() extension method no longer instantiates a new ReadOnlyList<T> when used on a ReadOnlyList<T>
  • ReadOnlyList<T>.Empty now returns a ReadOnlyList<T> instead of an IReadOnlyList<T>

UnitTesting

New package added to help unit testing ToolBX.Collections types

Breaking soon

Grid

  • GridChangedEventArgs<T>'s OldValues and NewValues properties will be changed to IReadOnlyList<T> (from IList<T>)

Inventory

  • Entry<T> will now throw an exception when you try to initialize its Quantity property with a negative or zero number

2.2.0-beta2

07 Jan 19:29
Compare
Choose a tag to compare
2.2.0-beta2 Pre-release
Pre-release
Changed publishing script and updated nugets