Skip to content

2.2.0

Compare
Choose a tag to compare
@Moreault Moreault released this 13 Jan 14:35
· 31 commits to master since this release
142d0da

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