EnumSourceGenerator 0.3.0
See the version list below for details.
dotnet add package EnumSourceGenerator --version 0.3.0
NuGet\Install-Package EnumSourceGenerator -Version 0.3.0
<PackageReference Include="EnumSourceGenerator" Version="0.3.0" />
paket add EnumSourceGenerator --version 0.3.0
#r "nuget: EnumSourceGenerator, 0.3.0"
// Install EnumSourceGenerator as a Cake Addin #addin nuget:?package=EnumSourceGenerator&version=0.3.0 // Install EnumSourceGenerator as a Cake Tool #tool nuget:?package=EnumSourceGenerator&version=0.3.0
EnumSourceGenerator
A source code generator for C# enums. Generates methods for converting to/from strings.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.CodeAnalysis.Analyzers (>= 3.3.4)
- Microsoft.CodeAnalysis.Common (>= 4.9.2)
- Microsoft.CodeAnalysis.CSharp (>= 4.9.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
- Parse method that simply calls TryParse, and throws if it fails
- If the enum is decorated with [Flags] as well, then more methods are generated
- The Flag() method works just like: (value & flag) == flag
- The ToStr() method takes into account multiple flags
- The FlagsToStr() method is called by ToStr() in the case of an enum decorated with [Flags] that has multiple flags set