CodeChops.MagicEnums
1.0.1
See the version list below for details.
dotnet add package CodeChops.MagicEnums --version 1.0.1
NuGet\Install-Package CodeChops.MagicEnums -Version 1.0.1
<PackageReference Include="CodeChops.MagicEnums" Version="1.0.1" />
<PackageVersion Include="CodeChops.MagicEnums" Version="1.0.1" />
<PackageReference Include="CodeChops.MagicEnums" />
paket add CodeChops.MagicEnums --version 1.0.1
#r "nuget: CodeChops.MagicEnums, 1.0.1"
#:package CodeChops.MagicEnums@1.0.1
#addin nuget:?package=CodeChops.MagicEnums&version=1.0.1
#tool nuget:?package=CodeChops.MagicEnums&version=1.0.1
Flexible and extendable enums for C#:
- It is possible to use other member values than integral types. For example:
- Strings that automatically represent their member name:
- This prohibits incorrect usage of integral values when they are not needed;
- It removes the need to keep track of (incremental) integral values;
- Custom defined types, for example see StrictDirection: https://github.com/Code-Chops/Geometry/;
- Inheritance and/or partial records can be used to extend your enums:
- Enums can now be extended in multiple projects;
- Custom methods can be added to enums, if necessary;
- Enum-members can be auto-discovered. This removes the need to keep track of used/unused enum-members:
- Explicitly:
- Is enabled by adding the DiscoverableEnumMembers-attribute;
- Use {Enum}.{Member}.CreateMember(...) to create a source generated enum-member on the fly;
- A member value (and comment) can be provided;
- Implicitly:
Is enabled by adding the DiscoverableEnumMembers-attribute with implicitDiscoverability = true;
Use {Enum}.{Member} to create a source generated enum-member on the fly;
Enum members can be added at runtime, if necessary;
Has the same functionality as the default .NET enum:
- Members can be found by using their name or value;
- Multiple members with the same value can even be looked up: This is not supported in default C# enums;
- Optimized, and therefore fast member registration / lookup;
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. 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. 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- CodeChops.GenericMath (>= 1.2.7)
- CodeChops.MagicEnums.SourceGeneration (>= 1.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on CodeChops.MagicEnums:
| Package | Downloads |
|---|---|
|
CodeChops.ImplementationDiscovery
Provides easy-accessible, design-time and runtime information about implementations throughout your code. |
|
|
CodeChops.MagicEnums.Json
Json (de)serialization for MagicEnums. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.1 | 2,142 | 2/21/2025 |
| 4.0.0 | 241 | 2/21/2025 |
| 3.9.3-alpha | 971 | 12/11/2024 |
| 3.9.2 | 1,648 | 10/16/2024 |
| 3.9.1 | 377 | 9/29/2024 |
| 3.9.0 | 934 | 3/20/2023 |
| 3.8.3 | 625 | 3/10/2023 |
| 3.8.2 | 675 | 3/6/2023 |
| 3.8.0 | 571 | 1/27/2023 |
| 3.7.1 | 559 | 1/22/2023 |
| 3.6.0 | 1,212 | 1/7/2023 |
| 3.5.0 | 565 | 1/6/2023 |
| 3.4.4 | 720 | 1/6/2023 |
| 3.4.2 | 506 | 1/4/2023 |
| 3.4.1 | 614 | 1/3/2023 |
| 3.4.0 | 548 | 1/2/2023 |
| 3.3.9 | 486 | 1/2/2023 |
| 3.3.5 | 536 | 12/23/2022 |
| 3.3.4 | 493 | 12/22/2022 |
| 3.3.3 | 451 | 12/19/2022 |
| 3.3.2 | 493 | 12/16/2022 |
| 3.3.1 | 484 | 12/15/2022 |
| 3.3.0 | 498 | 12/14/2022 |
| 2.9.9 | 736 | 9/17/2022 |
| 2.9.8 | 712 | 9/16/2022 |
| 2.9.5 | 734 | 9/16/2022 |
| 2.9.4 | 596 | 9/15/2022 |
| 2.9.3 | 638 | 9/14/2022 |
| 1.5.1 | 750 | 7/11/2022 |
| 1.5.0 | 913 | 7/11/2022 |
| 1.4.3 | 788 | 7/11/2022 |
| 1.4.2 | 1,448 | 7/10/2022 |
| 1.4.1 | 1,005 | 7/8/2022 |
| 1.3.10 | 729 | 7/8/2022 |
| 1.2.9 | 1,092 | 7/6/2022 |
| 1.2.8 | 620 | 7/6/2022 |
| 1.2.7 | 602 | 7/5/2022 |
| 1.2.6 | 596 | 7/5/2022 |
| 1.2.5 | 1,796 | 6/23/2022 |
| 1.2.4 | 602 | 6/22/2022 |
| 1.2.3 | 860 | 6/21/2022 |
| 1.2.2 | 658 | 6/14/2022 |
| 1.2.1 | 2,436 | 6/14/2022 |
| 1.2.0 | 1,579 | 6/13/2022 |
| 1.1.1 | 2,110 | 3/16/2022 |
| 1.1.0 | 626 | 3/9/2022 |
| 1.0.3 | 772 | 3/4/2022 |
| 1.0.2 | 643 | 3/3/2022 |
| 1.0.1 | 623 | 3/3/2022 |
| 0.9.6 | 647 | 2/20/2022 |
Removed clone as internal