MG.Collections
1.0.0
See the version list below for details.
dotnet add package MG.Collections --version 1.0.0
NuGet\Install-Package MG.Collections -Version 1.0.0
<PackageReference Include="MG.Collections" Version="1.0.0" />
paket add MG.Collections --version 1.0.0
#r "nuget: MG.Collections, 1.0.0"
// Install MG.Collections as a Cake Addin #addin nuget:?package=MG.Collections&version=1.0.0 // Install MG.Collections as a Cake Tool #tool nuget:?package=MG.Collections&version=1.0.0
Expanded Specialized Collections
WPF library - MG.Collections.Wpf
Helper libraries that provide some collection classes that I use in my projects. Some examples include:
UniqueList<T>
- Same as System.Collections.Generic.List<T> but ensures that each element is unique according to a custom IEqualityComparer<T> or the default.
// input is: "test test Test"
using MG.Collections;
using System;
namespace Test
{
class Program
{
static void Main(string[] args)
{
var col = new UniqueList<string>(args);
Console.WriteLine(col.Count); // outputs '1'
Console.WriteLine(col[0]); // outputs 'test'.
}
}
}
ManagedKeySortedList<TKey, TValue>
Similar to System.Collections.Generic.SortedList<TKey, TValue>. The difference is that the 'key' is retrieved from an incoming object using a specified Func<TValue, TKey> function defined in the constructor. Elements can be added then, and the 'key' will be retrieved automatically from it.
The other difference is that the default enumerator for this collection uses the simple List enumerator instead of a Dictionary one.
// input is: 1 2 87 2 "what up"
using MG.Collections;
using System;
using System.Collections;
using System.Collections.Generic;
namespace Test
{
class Program
{
static void Main(string[] args)
{
var sortedList = new ManagedKeySortedList<int, StringInt>(x => x.IntValue);
Array.ForEach((a) => {
sortedList.Add(a);
});
Console.WriteLine(sortedList.Count); // outputs '4'
}
}
struct StringInt
{
public int IntValue;
public string StrValue;
public static implicit operator StringInt(string parsingStr)
{
int intVal = -1;
if (int.TryParse(parsingStr, out int tryInt))
{
intVal = tryInt;
}
return new StringInt
{
IntValue = intVal,
StrValue = parsingStr
};
}
}
}
ReadOnlyList<T> & ReadOnlySet<T>
A List and a Set readonly wrapper (similiar to System.Collections.ObjectModel.ReadOnlyCollection<T>) exposing only the 'readonly' methods of the corresponding collection types.
- *NOTE* - In .NET5 projects, ReadOnlySet<T> implements System.Collections.Generic.IReadOnlySet<T>. All other target frameworks, it implements a custom MG.Collections.IReadOnly<T>.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.1
- No dependencies.
-
.NETFramework 4.6.2
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net5.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on MG.Collections:
Package | Downloads |
---|---|
MG.Collections.Wpf
A library consisting of list, collection, and set classes that can be used with WPF applications. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial Release