Skip to content
简体中文

Generate enum extensions ​

csharp
using GFramework.Core.SourceGenerators.Abstractions.Enums;

[GenerateEnumExtensions]
public enum RunMode { Menu, Playing, Ended }

Install GeWuYou.GFramework.Core.SourceGenerators in the consuming project and apply GenerateEnumExtensions to the enum. Control the corresponding tests with GenerateIsMethods and GenerateIsInMethod. Extensions use the enum's namespace. For an enum in the global namespace, import EnumExtensionsGenerated.

Apache License 2.0