{"id":13628943,"url":"https://github.com/OhFlowi/FusionReactor.SourceGenerators.EnumExtensions","last_synced_at":"2025-04-17T04:32:38.272Z","repository":{"id":231157423,"uuid":"781104125","full_name":"OhFlowi/FusionReactor.SourceGenerators.EnumExtensions","owner":"OhFlowi","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-12T23:20:33.000Z","size":144,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T20:51:55.393Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OhFlowi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-02T18:54:31.000Z","updated_at":"2025-03-12T23:17:26.000Z","dependencies_parsed_at":"2024-05-03T09:44:09.836Z","dependency_job_id":"66cc0b2b-1fe5-4b89-b860-fdb292abdd99","html_url":"https://github.com/OhFlowi/FusionReactor.SourceGenerators.EnumExtensions","commit_stats":null,"previous_names":["ohflowi/fusionreactor.sourcegenerators.enumextensions"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OhFlowi%2FFusionReactor.SourceGenerators.EnumExtensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OhFlowi%2FFusionReactor.SourceGenerators.EnumExtensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OhFlowi%2FFusionReactor.SourceGenerators.EnumExtensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OhFlowi%2FFusionReactor.SourceGenerators.EnumExtensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OhFlowi","download_url":"https://codeload.github.com/OhFlowi/FusionReactor.SourceGenerators.EnumExtensions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249316005,"owners_count":21249873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T22:00:59.981Z","updated_at":"2025-04-17T04:32:38.241Z","avatar_url":"https://github.com/OhFlowi.png","language":"C#","funding_links":[],"categories":["Content"],"sub_categories":["133. [FusionReactor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/FusionReactor) , in the [Enum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enum) category"],"readme":"[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/OhFlowi/FusionReactor.SourceGenerators.EnumExtensions/master/LICENSE)\n[![Nuget](https://img.shields.io/nuget/dt/FusionReactor.SourceGenerators.EnumExtensions?label=Nuget.org%20Downloads\u0026style=flat-square\u0026color=blue)](https://www.nuget.org/packages/FusionReactor.SourceGenerators.EnumExtensions)\n[![Nuget](https://img.shields.io/nuget/vpre/FusionReactor.SourceGenerators.EnumExtensions.svg?label=NuGet)](https://www.nuget.org/packages/FusionReactor.SourceGenerators.EnumExtensions)\n\n# FusionReactor.SourceGenerators.EnumExtensions\nA C# source generator to create extensions for an enum type.\n- Optimized for speed and low resource consumption\n- Support for non-standard enum declarations\n```csharp\npublic enum EPublicFoo : byte\n```\n- .NET 8+ support by using [FrozenDictionary](https://learn.microsoft.com/en-us/dotnet/api/system.collections.frozen.frozendictionary-2) \u0026 [FrozenSet](https://learn.microsoft.com/en-us/dotnet/api/system.collections.frozen.frozenset-1)\n- .NET 5+ support by using [IReadOnlyDictionary](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlydictionary-2) \u0026 [IReadOnlySet](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlyset-1)\n- .NET Framework 4.5+ support by using [IReadOnlyDictionary](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlydictionary-2) \u0026 [HashSet](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.hashset-1)\n\n**Package** - [FusionReactor.SourceGenerators.EnumExtensions](https://www.nuget.org/packages/FusionReactor.SourceGenerators.EnumExtensions/)\n\nAdd the package to your application using\n\n```bash\ndotnet add package FusionReactor.SourceGenerators.EnumExtensions\n```\n\nAdding the package will automatically add a marker attribute, `[GenerateEnumExtensions]`, to your project.\n\nTo use the generator, add the `[GenerateEnumExtensions]` attribute to an enum. For example:\n\n```csharp\n[GenerateEnumExtensions]\n[Description(\"Test 123\")]\n[IntArray(new[] { 123 })]\n[StringArray(new[] { \"Foo\", \"Bar\", \"Baz\" })]\npublic enum EPublicFoo\n{\n    [Display(\n        ShortName = \"Fo\",\n        Name = \"Foo - 0\",\n        Description = \"Zero\",\n        Prompt = \"ooF\",\n        GroupName = \"Foos\",\n        Order = 0)]\n    Foo = 0,\n\n    [Display(\n        ShortName = \"Ba\",\n        Name = \"Bar - 1\",\n        Description = \"One\",\n        Prompt = \"raB\",\n        GroupName = \"Bars\",\n        Order = 1)]\n    Bar = 1,\n\n    Batz = 2,\n}\n\n```\n\nThis will generate a class called `EPublicFooExtensions` (`EPublicFoo` + `Extensions`), which contains a number of helper methods. \n\n`EPublicFoo.Extensions.g.cs`:\n\n```csharp\n/// \u003csummary\u003e\n/// Extension methods for the \u003csee cref = \"EPublicFoo\"/\u003e enum.\n/// \u003c/summary\u003e\n[GeneratedCode(\"FusionReactor.SourceGenerators.EnumExtensions\", null)]\npublic static class EPublicFooExtensions\n{\n#if NET8_0_OR_GREATER\n    private static readonly FrozenDictionary\u003cEPublicFoo, Int32\u003e content\n        = new Dictionary\u003cEPublicFoo, Int32\u003e\n        {\n            { EPublicFoo.Foo, 0 },\n            { EPublicFoo.Bar, 1 },\n            { EPublicFoo.Batz, 2 },\n        }\n    .ToFrozenDictionary();\n#else\n    private static readonly Dictionary\u003cEPublicFoo, Int32\u003e contentDictionary\n        = new Dictionary\u003cEPublicFoo, Int32\u003e\n        {\n            { EPublicFoo.Foo, 0 },\n            { EPublicFoo.Bar, 1 },\n            { EPublicFoo.Batz, 2 },\n        };\n    \n    private static readonly IReadOnlyDictionary\u003cEPublicFoo, Int32\u003e content\n        = new ReadOnlyDictionary\u003cEPublicFoo, Int32\u003e(contentDictionary);\n#endif\n\n#if NET8_0_OR_GREATER\n    private static readonly FrozenSet\u003cstring\u003e names\n        = new HashSet\u003cstring\u003e()\n        {\n            \"Foo\",\n            \"Bar\",\n            \"Batz\",\n        }\n    .ToFrozenSet();\n#elif NET5_0_OR_GREATER\n    private static readonly IReadOnlySet\u003cstring\u003e names\n        = new HashSet\u003cstring\u003e()\n        {\n            \"Foo\",\n            \"Bar\",\n            \"Batz\",\n        };\n#else\n    private static readonly HashSet\u003cstring\u003e names\n        = new HashSet\u003cstring\u003e()\n        {\n            \"Foo\",\n            \"Bar\",\n            \"Batz\",\n        };\n#endif\n\n#if NET8_0_OR_GREATER\n    private static readonly FrozenSet\u003cEPublicFoo\u003e values\n        = new HashSet\u003cEPublicFoo\u003e()\n        {\n            EPublicFoo.Foo,\n            EPublicFoo.Bar,\n            EPublicFoo.Batz,\n        }\n    .ToFrozenSet();\n#elif NET5_0_OR_GREATER\n    private static readonly IReadOnlySet\u003cEPublicFoo\u003e names\n        = new HashSet\u003cEPublicFoo\u003e()\n        {\n            EPublicFoo.Foo,\n            EPublicFoo.Bar,\n            EPublicFoo.Batz,\n        };\n#else\n    private static readonly HashSet\u003cEPublicFoo\u003e names\n        = new HashSet\u003cEPublicFoo\u003e()\n        {\n            EPublicFoo.Foo,\n            EPublicFoo.Bar,\n            EPublicFoo.Batz,\n        };\n#endif\n\n#if NET8_0_OR_GREATER\n    private static readonly FrozenSet\u003cAttribute\u003e rootAttributes\n        = new HashSet\u003cAttribute\u003e()\n        {\n            new global::FusionReactor.SourceGenerators.EnumExtensions.GenerateEnumExtensionsAttribute(),\n            new global::System.ComponentModel.DescriptionAttribute(\n                \"Test 123\"),\n            new global::FusionReactor.SourceGenerators.EnumExtensions.Tests.Attributes.IntArrayAttribute(\n                new int[]{ 123 }),\n            new global::FusionReactor.SourceGenerators.EnumExtensions.Tests.Attributes.StringArrayAttribute(\n                new string[]{ \"Foo\", \"Bar\", \"Baz\" }),\n        }\n    .ToFrozenSet();\n#elif NET5_0_OR_GREATER\n    private static readonly IReadOnlySet\u003cAttribute\u003e rootAttributes\n        = new HashSet\u003cAttribute\u003e()\n        {\n            new global::FusionReactor.SourceGenerators.EnumExtensions.GenerateEnumExtensionsAttribute(),\n            new global::System.ComponentModel.DescriptionAttribute(\n                \"Test 123\"),\n            new global::FusionReactor.SourceGenerators.EnumExtensions.Tests.Attributes.IntArrayAttribute(\n                new int[]{ 123 }),\n            new global::FusionReactor.SourceGenerators.EnumExtensions.Tests.Attributes.StringArrayAttribute(\n                new string[]{ \"Foo\", \"Bar\", \"Baz\" }),\n        };\n#else\n    private static readonly HashSet\u003cAttribute\u003e rootAttributes\n        = new HashSet\u003cAttribute\u003e()\n        {\n            new global::FusionReactor.SourceGenerators.EnumExtensions.GenerateEnumExtensionsAttribute(),\n            new global::System.ComponentModel.DescriptionAttribute(\n                \"Test 123\"),\n            new global::FusionReactor.SourceGenerators.EnumExtensions.Tests.Attributes.IntArrayAttribute(\n                new int[]{ 123 }),\n            new global::FusionReactor.SourceGenerators.EnumExtensions.Tests.Attributes.StringArrayAttribute(\n                new string[]{ \"Foo\", \"Bar\", \"Baz\" }),\n        };\n#endif\n\n#if NET8_0_OR_GREATER\n    private static readonly FrozenDictionary\u003cEPublicFoo, Attribute[]\u003e memberAttributes\n        = new Dictionary\u003cEPublicFoo, Attribute[]\u003e()\n        {\n            {\n                EPublicFoo.Foo,\n                new Attribute[1]\n                {\n                    new global::System.ComponentModel.DataAnnotations.DisplayAttribute()\n                    {\n                        ShortName = \"Fo\",\n                        Name = \"Foo - 0\",\n                        Description = \"Zero\",\n                        Prompt = \"ooF\",\n                        GroupName = \"Foos\",\n                        Order = 0,\n                    },\n                }\n            },\n            {\n                EPublicFoo.Bar,\n                new Attribute[1]\n                {\n                    new global::System.ComponentModel.DataAnnotations.DisplayAttribute()\n                    {\n                        ShortName = \"Ba\",\n                        Name = \"Bar - 1\",\n                        Description = \"One\",\n                        Prompt = \"raB\",\n                        GroupName = \"Bars\",\n                        Order = 1,\n                    },\n                }\n            },\n            {\n                EPublicFoo.Batz,\n                new Attribute[0]\n            },\n        }\n    .ToFrozenDictionary();\n#else\n    private static readonly Dictionary\u003cEPublicFoo, Attribute[]\u003e memberAttributesDictionary\n        = new Dictionary\u003cEPublicFoo, Attribute[]\u003e()\n        {\n            {\n                EPublicFoo.Foo,\n                new Attribute[1]\n                {\n                    new global::System.ComponentModel.DataAnnotations.DisplayAttribute()\n                    {\n                        ShortName = \"Fo\",\n                        Name = \"Foo - 0\",\n                        Description = \"Zero\",\n                        Prompt = \"ooF\",\n                        GroupName = \"Foos\",\n                        Order = 0,\n                    },\n                }\n            },\n            {\n                EPublicFoo.Bar,\n                new Attribute[1]\n                {\n                    new global::System.ComponentModel.DataAnnotations.DisplayAttribute()\n                    {\n                        ShortName = \"Ba\",\n                        Name = \"Bar - 1\",\n                        Description = \"One\",\n                        Prompt = \"raB\",\n                        GroupName = \"Bars\",\n                        Order = 1,\n                    },\n                }\n            },\n            {\n                EPublicFoo.Batz,\n                new Attribute[0]\n            },\n        };\n    \n    private static readonly IReadOnlyDictionary\u003cEPublicFoo, Attribute[]\u003e memberAttributes\n        = new ReadOnlyDictionary\u003cEPublicFoo, Attribute[]\u003e(memberAttributesDictionary);\n#endif\n\n    /// \u003csummary\u003e\n    /// Gets the content dictionary containing mappings of \u003csee cref=\"EPublicFoo\"/\u003e enum values to values.\n    /// \u003c/summary\u003e\n    /// \u003creturns\u003eThe read-only content dictionary.\u003c/returns\u003e\n#if NET8_0_OR_GREATER\n    public static FrozenDictionary\u003cEPublicFoo, Int32\u003e GetContent()\n#else\n    public static IReadOnlyDictionary\u003cEPublicFoo, Int32\u003e GetContent()\n#endif\n        =\u003e content;\n    \n    /// \u003csummary\u003e\n    /// Gets the content dictionary containing mappings of \u003csee cref=\"EPublicFoo\"/\u003e enum values to values.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"enumValue\"\u003eThe enum value for which to get the content dictionary.\u003c/param\u003e\n    /// \u003creturns\u003eThe read-only content dictionary.\u003c/returns\u003e\n#if NET8_0_OR_GREATER\n    public static FrozenDictionary\u003cEPublicFoo, Int32\u003e GetContent(this EPublicFoo enumValue)\n#else\n    public static IReadOnlyDictionary\u003cEPublicFoo, Int32\u003e GetContent(this EPublicFoo enumValue)\n#endif\n        =\u003e content;\n\n    /// \u003csummary\u003e\n    /// Retrieves the name of the constant in the \u003csee cref=\"EPublicFoo\"/\u003e.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"enumValue\"\u003eThe enum value to convert.\u003c/param\u003e\n    /// \u003creturns\u003e\n    /// A string containing the name of the \u003csee cref=\"EPublicFoo\"/\u003e;\n    /// or \u003csee langword=\"null\"/\u003e if no such constant is found.\n    /// \u003c/returns\u003e\n    public static string? GetName(this EPublicFoo enumValue)\n        =\u003e enumValue switch\n        {\n            EPublicFoo.Foo =\u003e nameof(EPublicFoo.Foo),\n            EPublicFoo.Bar =\u003e nameof(EPublicFoo.Bar),\n            EPublicFoo.Batz =\u003e nameof(EPublicFoo.Batz),\n            _ =\u003e null,\n        };\n    \n    /// \u003csummary\u003e\n    /// Retrieves all available names of the \u003csee cref=\"EPublicFoo\"/\u003e.\n    /// \u003c/summary\u003e\n    /// \u003creturns\u003eAn enumerable collection of \u003csee cref=\"EPublicFoo\"/\u003e names.\u003c/returns\u003e\n#if NET8_0_OR_GREATER\n    public static FrozenSet\u003cstring\u003e GetNames()\n#elif NET5_0_OR_GREATER\n    public static IReadOnlySet\u003cstring\u003e GetNames()\n#else\n    public static HashSet\u003cstring\u003e GetNames()\n#endif\n        =\u003e names;\n    \n    /// \u003csummary\u003e\n    /// Retrieves all available names of the \u003csee cref=\"EPublicFoo\"/\u003e.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"enumValue\"\u003eThe enumeration value.\u003c/param\u003e\n    /// \u003creturns\u003eAn enumerable collection of \u003csee cref=\"EPublicFoo\"/\u003e names.\u003c/returns\u003e\n#if NET8_0_OR_GREATER\n    public static FrozenSet\u003cstring\u003e GetNames(this EPublicFoo enumValue)\n#elif NET5_0_OR_GREATER\n    public static IReadOnlySet\u003cstring\u003e GetNames(this EPublicFoo enumValue)\n#else\n    public static HashSet\u003cstring\u003e GetNames(this EPublicFoo enumValue)\n#endif\n        =\u003e names;\n\n    /// \u003csummary\u003e\n    /// Retrieves all available values of the \u003csee cref=\"EPublicFoo\"/\u003e.\n    /// \u003c/summary\u003e\n    /// \u003creturns\u003eAn enumerable collection of \u003csee cref=\"EPublicFoo\"/\u003e values.\u003c/returns\u003e\n#if NET8_0_OR_GREATER\n    public static FrozenSet\u003cEPublicFoo\u003e GetValues()\n#elif NET5_0_OR_GREATER\n    public static IReadOnlySet\u003cEPublicFoo\u003e GetValues()\n#else\n    public static HashSet\u003cEPublicFoo\u003e GetValues()\n#endif\n        =\u003e values;\n    \n    /// \u003csummary\u003e\n    /// Retrieves all available values of the \u003csee cref=\"EPublicFoo\"/\u003e.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"enumValue\"\u003eThe enumeration value.\u003c/param\u003e\n    /// \u003creturns\u003eAn enumerable collection of \u003csee cref=\"EPublicFoo\"/\u003e values.\u003c/returns\u003e\n#if NET8_0_OR_GREATER\n    public static FrozenSet\u003cEPublicFoo\u003e GetValues(this EPublicFoo enumValue)\n#elif NET5_0_OR_GREATER\n    public static IReadOnlySet\u003cEPublicFoo\u003e GetValues(this EPublicFoo enumValue)\n#else\n    public static HashSet\u003cEPublicFoo\u003e GetValues(this EPublicFoo enumValue)\n#endif\n        =\u003e values;\n\n    /// \u003csummary\u003e\n    /// Parses the specified string representation of the enumeration value to its corresponding\n    /// \u003csee cref=\"EPublicFoo\"/\u003e value.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"value\"\u003eA string containing the name or value to convert.\u003c/param\u003e\n    /// \u003cparam name=\"ignoreCase\"\u003e\n    /// A boolean indicating whether to ignore case during the parsing. Default is \u003cc\u003efalse\u003c/c\u003e.\n    /// \u003c/param\u003e\n    /// \u003creturns\u003e\n    /// The \u003csee cref=\"EPublicFoo\"/\u003e value equivalent to the specified string representation.\n    /// \u003c/returns\u003e\n    public static EPublicFoo ParseFast(string value, bool ignoreCase = false)\n    {\n        if (ignoreCase)\n        {\n            return value.ToLowerInvariant() switch\n            {\n                \"foo\" =\u003e EPublicFoo.Foo,\n                \"bar\" =\u003e EPublicFoo.Bar,\n                \"batz\" =\u003e EPublicFoo.Batz,\n                _ =\u003e throw new ArgumentException(),\n            };\n        }\n        else\n        {\n            return value switch\n            {\n                \"Foo\" =\u003e EPublicFoo.Foo,\n                \"Bar\" =\u003e EPublicFoo.Bar,\n                \"Batz\" =\u003e EPublicFoo.Batz,\n                _ =\u003e throw new ArgumentException(),\n            };\n        }\n    }\n    \n    /// \u003csummary\u003e\n    /// Parses the specified string representation of the enumeration value to its corresponding\n    /// \u003csee cref=\"EPublicFoo\"/\u003e value.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"enumValue\"\u003eThe enumeration value.\u003c/param\u003e\n    /// \u003cparam name=\"value\"\u003eA string containing the name or value to convert.\u003c/param\u003e\n    /// \u003cparam name=\"ignoreCase\"\u003e\n    /// A boolean indicating whether to ignore case during the parsing. Default is \u003cc\u003efalse\u003c/c\u003e.\n    /// \u003c/param\u003e\n    /// \u003creturns\u003e\n    /// The \u003csee cref=\"EPublicFoo\"/\u003e value equivalent to the specified string representation.\n    /// \u003c/returns\u003e\n    public static EPublicFoo ParseFast(this EPublicFoo enumValue, string value, bool ignoreCase = false)\n    {\n        if (ignoreCase)\n        {\n            return value.ToLowerInvariant() switch\n            {\n                \"foo\" =\u003e EPublicFoo.Foo,\n                \"bar\" =\u003e EPublicFoo.Bar,\n                \"batz\" =\u003e EPublicFoo.Batz,\n                _ =\u003e throw new ArgumentException(),\n            };\n        }\n        else\n        {\n            return value switch\n            {\n                \"Foo\" =\u003e EPublicFoo.Foo,\n                \"Bar\" =\u003e EPublicFoo.Bar,\n                \"Batz\" =\u003e EPublicFoo.Batz,\n                _ =\u003e throw new ArgumentException(),\n            };\n        }\n    }\n\n    /// \u003csummary\u003e\n    /// Tries to parse the specified string representation of an enumeration value to its corresponding\n    /// \u003csee cref=\"EPublicFoo\"/\u003e enumeration value.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"value\"\u003eThe string representation of the enumeration value.\u003c/param\u003e\n    /// \u003cparam name=\"result\"\u003e\n    /// When this method returns, contains the \u003csee cref=\"EPublicFoo\"/\u003e value equivalent\n    /// to the string representation, if the parse succeeded, or default(EPublicFoo) if the parse failed.\u003c/param\u003e\n    /// \u003creturns\u003e\u003cc\u003etrue\u003c/c\u003e if the parsing was successful; otherwise, \u003cc\u003efalse\u003c/c\u003e.\u003c/returns\u003e\n    public static bool TryParseFast(string value, out EPublicFoo? result)\n        =\u003e TryParseFast(value, false, out result);\n    \n    /// \u003csummary\u003e\n    /// Tries to parse the specified string representation of an enumeration value to its corresponding\n    /// \u003csee cref=\"EPublicFoo\"/\u003e enumeration value.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"value\"\u003eThe value to parse.\u003c/param\u003e\n    /// \u003cparam name=\"ignoreCase\"\u003e\n    /// A boolean indicating whether to ignore case during the parsing. Default is \u003cc\u003efalse\u003c/c\u003e.\n    /// \u003c/param\u003e\n    /// \u003cparam name=\"result\"\u003e\n    /// When this method returns, contains the \u003csee cref=\"EPublicFoo\"/\u003e value equivalent\n    /// to the string representation, if the parse succeeded, or \u003cc\u003enull\u003c/c\u003e if the parse failed.\n    /// \u003c/param\u003e\n    /// \u003creturns\u003e\u003cc\u003etrue\u003c/c\u003e if the parsing was successful; otherwise, \u003cc\u003efalse\u003c/c\u003e.\u003c/returns\u003e\n    public static bool TryParseFast(string value, bool ignoreCase, out EPublicFoo? result)\n    {\n        if (ignoreCase)\n        {\n            result = value.ToLowerInvariant() switch\n            {\n                \"foo\" =\u003e EPublicFoo.Foo,\n                \"bar\" =\u003e EPublicFoo.Bar,\n                \"batz\" =\u003e EPublicFoo.Batz,\n                _ =\u003e null,\n            };\n        }\n        else\n        {\n            result = value switch\n            {\n                \"Foo\" =\u003e EPublicFoo.Foo,\n                \"Bar\" =\u003e EPublicFoo.Bar,\n                \"Batz\" =\u003e EPublicFoo.Batz,\n                _ =\u003e null,\n            };\n        }\n        \n        return result is not null;\n    }\n    \n    /// \u003csummary\u003e\n    /// Tries to parse the specified string representation of an enumeration value to its corresponding\n    /// \u003csee cref=\"EPublicFoo\"/\u003e enumeration value.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"enumValue\"\u003eThe enumeration value.\u003c/param\u003e\n    /// \u003cparam name=\"value\"\u003eThe value to parse.\u003c/param\u003e\n    /// \u003cparam name=\"result\"\u003e\n    /// When this method returns, contains the \u003csee cref=\"EPublicFoo\"/\u003e value equivalent\n    /// to the string representation, if the parse succeeded, or \u003cc\u003enull\u003c/c\u003e if the parse failed.\n    /// \u003c/param\u003e\n    /// \u003creturns\u003e\u003cc\u003etrue\u003c/c\u003e if the parsing was successful; otherwise, \u003cc\u003efalse\u003c/c\u003e.\u003c/returns\u003e\n    public static bool TryParseFast(this EPublicFoo enumValue, string value, out EPublicFoo? result)\n        =\u003e enumValue.TryParseFast(value, false, out result);\n    \n    /// \u003csummary\u003e\n    /// Tries to parse the specified string representation of an enumeration value to its corresponding\n    /// \u003csee cref=\"EPublicFoo\"/\u003e enumeration value.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"enumValue\"\u003eThe enumeration value.\u003c/param\u003e\n    /// \u003cparam name=\"value\"\u003eThe value to parse.\u003c/param\u003e\n    /// \u003cparam name=\"ignoreCase\"\u003e\n    /// A boolean indicating whether to ignore case during the parsing. Default is \u003cc\u003efalse\u003c/c\u003e.\n    /// \u003c/param\u003e\n    /// \u003cparam name=\"result\"\u003e\n    /// When this method returns, contains the \u003csee cref=\"EPublicFoo\"/\u003e value equivalent\n    /// to the string representation, if the parse succeeded, or \u003cc\u003enull\u003c/c\u003e if the parse failed.\n    /// \u003c/param\u003e\n    /// \u003creturns\u003e\u003cc\u003etrue\u003c/c\u003e if the parsing was successful; otherwise, \u003cc\u003efalse\u003c/c\u003e.\u003c/returns\u003e\n    public static bool TryParseFast(this EPublicFoo enumValue, string value, bool ignoreCase, out EPublicFoo? result)\n    {\n        if (ignoreCase)\n        {\n            result = value.ToLowerInvariant() switch\n            {\n                \"foo\" =\u003e EPublicFoo.Foo,\n                \"bar\" =\u003e EPublicFoo.Bar,\n                \"batz\" =\u003e EPublicFoo.Batz,\n                _ =\u003e null,\n            };\n        }\n        else\n        {\n            result = value switch\n            {\n                \"Foo\" =\u003e EPublicFoo.Foo,\n                \"Bar\" =\u003e EPublicFoo.Bar,\n                \"Batz\" =\u003e EPublicFoo.Batz,\n                _ =\u003e null,\n            };\n        }\n        \n        return result is not null;\n    }\n\n    /// \u003csummary\u003e\n    /// Retrieves all available attributes of the \u003csee cref=\"EPublicFoo\"/\u003e.\n    /// \u003c/summary\u003e\n    /// \u003creturns\u003eAn enumerable collection of \u003csee cref=\"EPublicFoo\"/\u003e attributes.\u003c/returns\u003e\n#if NET8_0_OR_GREATER\n    public static FrozenSet\u003cAttribute\u003e GetRootAttributes()\n#elif NET5_0_OR_GREATER\n    public static IReadOnlySet\u003cAttribute\u003e GetRootAttributes()\n#else\n    public static HashSet\u003cAttribute\u003e GetRootAttributes()\n#endif\n        =\u003e rootAttributes;\n    \n    /// \u003csummary\u003e\n    /// Retrieves all available attributes of the \u003csee cref=\"EPublicFoo\"/\u003e.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"enumValue\"\u003eThe enumeration value.\u003c/param\u003e\n    /// \u003creturns\u003eAn enumerable collection of \u003csee cref=\"EPublicFoo\"/\u003e attributes.\u003c/returns\u003e\n#if NET8_0_OR_GREATER\n    public static FrozenSet\u003cAttribute\u003e GetRootAttributes(this EPublicFoo enumValue)\n#elif NET5_0_OR_GREATER\n    public static IReadOnlySet\u003cAttribute\u003e GetRootAttributes(this EPublicFoo enumValue)\n#else\n    public static HashSet\u003cAttribute\u003e GetRootAttributes(this EPublicFoo enumValue)\n#endif\n        =\u003e rootAttributes;\n\n    /// \u003csummary\u003e\n    /// Retrieves all available attributes of the \u003csee cref=\"EPublicFoo\"/\u003e.\n    /// \u003c/summary\u003e\n    /// \u003creturns\u003eAn enumerable collection of \u003csee cref=\"EPublicFoo\"/\u003e attributes.\u003c/returns\u003e\n#if NET8_0_OR_GREATER\n    public static FrozenDictionary\u003cEPublicFoo, Attribute[]\u003e GetMemberAttributes()\n#else\n    public static Dictionary\u003cEPublicFoo, Attribute[]\u003e GetMemberAttributes()\n#endif\n        =\u003e memberAttributes;\n    \n    /// \u003csummary\u003e\n    /// Retrieves all available attributes of the \u003csee cref=\"EPublicFoo\"/\u003e.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"enumValue\"\u003eThe enumeration value.\u003c/param\u003e\n    /// \u003creturns\u003eAn enumerable collection of \u003csee cref=\"EPublicFoo\"/\u003e attributes.\u003c/returns\u003e\n#if NET8_0_OR_GREATER\n    public static FrozenDictionary\u003cEPublicFoo, Attribute[]\u003e GetMemberAttributes(this EPublicFoo enumValue)\n#else\n    public static Dictionary\u003cEPublicFoo, Attribute[]\u003e GetMemberAttributes(this EPublicFoo enumValue)\n#endif\n        =\u003e memberAttributes;\n}\n\n```\n\n\nThe generated extension files are available in your IDE under the Source Generators files.\n\n## Contributing\n\nCreate an [issue](https://github.com/OhFlowi/FusionReactor.SourceGenerators.EnumExtensions/issues/new) if you find a BUG or have a Suggestion or Question. If you want to develop this project :\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request\n\n## License\n\nFusionReactor.SourceGenerators.EnumExtensions is Copyright © 2024 [OhFlowi](https://github.com/OhFlowi) under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOhFlowi%2FFusionReactor.SourceGenerators.EnumExtensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOhFlowi%2FFusionReactor.SourceGenerators.EnumExtensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOhFlowi%2FFusionReactor.SourceGenerators.EnumExtensions/lists"}