From cb8f0501ab29caa8ab311f36bc3ab9dc58759df0 Mon Sep 17 00:00:00 2001 From: Andrei Ignat Date: Sat, 4 Oct 2025 07:56:27 +0300 Subject: [PATCH 1/2] first iteration --- README.md | 113 ++-- later.md | 36 +- v2/Generator/MultiGeneratorV2.cs | 4 +- v2/Generator/all.csv | 1 + v2/RSCGExamplesData/GeneratorDataRec.json | 6 + v2/RSCGExamplesData/NoExample.json | 5 - v2/rscg_examples/RapidEnum/description.json | 22 + v2/rscg_examples/RapidEnum/nuget.txt | 1 + v2/rscg_examples/RapidEnum/readme.txt | 220 ++++++ .../RapidEnum/src/.tours/RapidEnum.tour | 42 ++ v2/rscg_examples/RapidEnum/src/EnumDemo.sln | 25 + .../RapidEnum/src/EnumDemo/CarTypes.cs | 11 + .../RapidEnum/src/EnumDemo/EnumDemo.csproj | 19 + .../RapidEnum/src/EnumDemo/Program.cs | 10 + v2/rscg_examples/RapidEnum/video.json | 39 ++ v2/rscg_examples_site/docs/Categories/Enum.md | 6 +- .../docs/Categories/_PrimitiveEnum.mdx | 4 +- v2/rscg_examples_site/docs/NoExamples.md | 210 +++--- .../docs/RSCG-Examples/RapidEnum.md | 639 ++++++++++++++++++ .../docs/RSCG-Examples/index.md | 13 +- v2/rscg_examples_site/docs/about.md | 2 +- v2/rscg_examples_site/docs/indexRSCG.md | 5 +- .../src/components/HomepageFeatures/index.js | 2 +- .../static/exports/RSCG.json | 8 + .../static/exports/RSCG.xlsx | Bin 12577 -> 12617 bytes 25 files changed, 1250 insertions(+), 193 deletions(-) create mode 100644 v2/rscg_examples/RapidEnum/description.json create mode 100644 v2/rscg_examples/RapidEnum/nuget.txt create mode 100644 v2/rscg_examples/RapidEnum/readme.txt create mode 100644 v2/rscg_examples/RapidEnum/src/.tours/RapidEnum.tour create mode 100644 v2/rscg_examples/RapidEnum/src/EnumDemo.sln create mode 100644 v2/rscg_examples/RapidEnum/src/EnumDemo/CarTypes.cs create mode 100644 v2/rscg_examples/RapidEnum/src/EnumDemo/EnumDemo.csproj create mode 100644 v2/rscg_examples/RapidEnum/src/EnumDemo/Program.cs create mode 100644 v2/rscg_examples/RapidEnum/video.json create mode 100644 v2/rscg_examples_site/docs/RSCG-Examples/RapidEnum.md diff --git a/README.md b/README.md index 40ad7ef25..f4a1b6312 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# RSCG - 233 Examples of Roslyn Source Code Generators / 14 created by Microsoft / +# RSCG - 234 Examples of Roslyn Source Code Generators / 14 created by Microsoft / -The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 233 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports. +The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 234 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports. This system serves as both a learning resource for .NET developers interested in source generators and an automated pipeline for maintaining up-to-date documentation about the RSCG ecosystem -## Latest Update : 2025-10-03 => 03 October 2025 +## Latest Update : 2025-10-04 => 04 October 2025 If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)*** @@ -24,8 +24,30 @@ If you want to be notified each time I add a new RSCG example , please click htt ## Content -Those are the 233 Roslyn Source Code Generators that I have tested you can see and download source code example. +Those are the 234 Roslyn Source Code Generators that I have tested you can see and download source code example. ( including 14 from Microsoft ) +### 234. [RapidEnum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/RapidEnum) , in the [Enum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enum) category + +Generated on : 2025-10-04 => 04 October 2025 + +
+ Expand + + + +Author: hanachiru + +Enum utility with SourceGenerator for C#/.NET + +Nuget: [https://www.nuget.org/packages/RapidEnum/](https://www.nuget.org/packages/RapidEnum/) + + +Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/RapidEnum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/RapidEnum) + +Source: [https://github.com/hanachiru/RapidEnum](https://github.com/hanachiru/RapidEnum) + +
+ ### 233. [VYaml](https://ignatandrei.github.io/RSCG_Examples/v2/docs/VYaml) , in the [Serializer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#serializer) category Generated on : 2025-10-03 => 03 October 2025 @@ -5510,273 +5532,266 @@ Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/GaoNian-NET/MapperToolkit&body=https://github.com/GaoNian-NET/MapperToolkit -28) [https://github.com/hanachiru/RapidEnum]( https://github.com/hanachiru/RapidEnum) , https://github.com/hanachiru/RapidEnum - -Why I have not tested : later - -https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/hanachiru/RapidEnum&body=https://github.com/hanachiru/RapidEnum - - -29) [https://github.com/Hookyns/validly]( https://github.com/Hookyns/validly) , https://github.com/Hookyns/validly +28) [https://github.com/Hookyns/validly]( https://github.com/Hookyns/validly) , https://github.com/Hookyns/validly Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/Hookyns/validly&body=https://github.com/Hookyns/validly -30) [https://github.com/inputfalken/Dynatello]( https://github.com/inputfalken/Dynatello) , https://github.com/inputfalken/Dynatello +29) [https://github.com/inputfalken/Dynatello]( https://github.com/inputfalken/Dynatello) , https://github.com/inputfalken/Dynatello Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/inputfalken/Dynatello&body=https://github.com/inputfalken/Dynatello -31) [https://github.com/ionite34/MinimalApiMapper]( https://github.com/ionite34/MinimalApiMapper) , https://github.com/ionite34/MinimalApiMapper +30) [https://github.com/ionite34/MinimalApiMapper]( https://github.com/ionite34/MinimalApiMapper) , https://github.com/ionite34/MinimalApiMapper Why I have not tested : own idea where to generate files, so overwrites https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/ionite34/MinimalApiMapper&body=https://github.com/ionite34/MinimalApiMapper -32) [https://github.com/JasonBock/CslaGeneratorSerialization]( https://github.com/JasonBock/CslaGeneratorSerialization) , https://github.com/JasonBock/CslaGeneratorSerialization +31) [https://github.com/JasonBock/CslaGeneratorSerialization]( https://github.com/JasonBock/CslaGeneratorSerialization) , https://github.com/JasonBock/CslaGeneratorSerialization Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/JasonBock/CslaGeneratorSerialization&body=https://github.com/JasonBock/CslaGeneratorSerialization -33) [https://github.com/nuskey8/Csv-CSharp]( https://github.com/nuskey8/Csv-CSharp) , https://github.com/nuskey8/Csv-CSharp +32) [https://github.com/nuskey8/Csv-CSharp]( https://github.com/nuskey8/Csv-CSharp) , https://github.com/nuskey8/Csv-CSharp Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/nuskey8/Csv-CSharp&body=https://github.com/nuskey8/Csv-CSharp -34) [https://github.com/OrgEleCho/EleCho.Internationalization]( https://github.com/OrgEleCho/EleCho.Internationalization) , https://github.com/OrgEleCho/EleCho.Internationalization +33) [https://github.com/OrgEleCho/EleCho.Internationalization]( https://github.com/OrgEleCho/EleCho.Internationalization) , https://github.com/OrgEleCho/EleCho.Internationalization Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/OrgEleCho/EleCho.Internationalization&body=https://github.com/OrgEleCho/EleCho.Internationalization -35) [https://github.com/pierre3/PlantUmlClassDiagramGenerator]( https://github.com/pierre3/PlantUmlClassDiagramGenerator) , https://github.com/pierre3/PlantUmlClassDiagramGenerator +34) [https://github.com/pierre3/PlantUmlClassDiagramGenerator]( https://github.com/pierre3/PlantUmlClassDiagramGenerator) , https://github.com/pierre3/PlantUmlClassDiagramGenerator Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/pierre3/PlantUmlClassDiagramGenerator&body=https://github.com/pierre3/PlantUmlClassDiagramGenerator -36) [https://github.com/stbychkov/AutoLoggerMessage]( https://github.com/stbychkov/AutoLoggerMessage) , https://github.com/stbychkov/AutoLoggerMessage +35) [https://github.com/stbychkov/AutoLoggerMessage]( https://github.com/stbychkov/AutoLoggerMessage) , https://github.com/stbychkov/AutoLoggerMessage Why I have not tested : Microsoft have done same feature https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/stbychkov/AutoLoggerMessage&body=https://github.com/stbychkov/AutoLoggerMessage -37) [https://github.com/Stepami/visitor-net]( https://github.com/Stepami/visitor-net) , https://github.com/Stepami/visitor-net +36) [https://github.com/Stepami/visitor-net]( https://github.com/Stepami/visitor-net) , https://github.com/Stepami/visitor-net Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/Stepami/visitor-net&body=https://github.com/Stepami/visitor-net -38) [https://github.com/svee4/RequiredStaticMembers]( https://github.com/svee4/RequiredStaticMembers) , https://github.com/svee4/RequiredStaticMembers +37) [https://github.com/svee4/RequiredStaticMembers]( https://github.com/svee4/RequiredStaticMembers) , https://github.com/svee4/RequiredStaticMembers Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/svee4/RequiredStaticMembers&body=https://github.com/svee4/RequiredStaticMembers -39) [https://github.com/SzymonHalucha/Minerals.AutoCommands]( https://github.com/SzymonHalucha/Minerals.AutoCommands) , https://github.com/SzymonHalucha/Minerals.AutoCommands +38) [https://github.com/SzymonHalucha/Minerals.AutoCommands]( https://github.com/SzymonHalucha/Minerals.AutoCommands) , https://github.com/SzymonHalucha/Minerals.AutoCommands Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/SzymonHalucha/Minerals.AutoCommands&body=https://github.com/SzymonHalucha/Minerals.AutoCommands -40) [https://github.com/Teleopti/Saspect]( https://github.com/Teleopti/Saspect) , https://github.com/Teleopti/Saspect +39) [https://github.com/Teleopti/Saspect]( https://github.com/Teleopti/Saspect) , https://github.com/Teleopti/Saspect Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/Teleopti/Saspect&body=https://github.com/Teleopti/Saspect -41) [https://github.com/TheFo2sh/AsyncFlow]( https://github.com/TheFo2sh/AsyncFlow) , https://github.com/TheFo2sh/AsyncFlow +40) [https://github.com/TheFo2sh/AsyncFlow]( https://github.com/TheFo2sh/AsyncFlow) , https://github.com/TheFo2sh/AsyncFlow Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/TheFo2sh/AsyncFlow&body=https://github.com/TheFo2sh/AsyncFlow -42) [https://github.com/wieslawsoltes/ReactiveGenerator]( https://github.com/wieslawsoltes/ReactiveGenerator) , https://github.com/wieslawsoltes/ReactiveGenerator +41) [https://github.com/wieslawsoltes/ReactiveGenerator]( https://github.com/wieslawsoltes/ReactiveGenerator) , https://github.com/wieslawsoltes/ReactiveGenerator Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=https://github.com/wieslawsoltes/ReactiveGenerator&body=https://github.com/wieslawsoltes/ReactiveGenerator -43) [Intellenum]( https://github.com/SteveDunn/Intellenum) , https://github.com/SteveDunn/Intellenum +42) [Intellenum]( https://github.com/SteveDunn/Intellenum) , https://github.com/SteveDunn/Intellenum Why I have not tested : not understand how to use https://github.com/ignatandrei/RSCG_Examples/issues/new?title=Intellenum&body=https://github.com/SteveDunn/Intellenum -44) [laker]( https://github.com/Lakerfield/Lakerfield.Rpc) , https://github.com/Lakerfield/Lakerfield.Rpc +43) [laker]( https://github.com/Lakerfield/Lakerfield.Rpc) , https://github.com/Lakerfield/Lakerfield.Rpc Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=laker&body=https://github.com/Lakerfield/Lakerfield.Rpc -45) [LoggingDecoratorGenerator]( https://github.com/DavidFineboym/LoggingDecoratorGenerator) , https://github.com/DavidFineboym/LoggingDecoratorGenerator +44) [LoggingDecoratorGenerator]( https://github.com/DavidFineboym/LoggingDecoratorGenerator) , https://github.com/DavidFineboym/LoggingDecoratorGenerator Why I have not tested : Microsoft have done same feature https://github.com/ignatandrei/RSCG_Examples/issues/new?title=LoggingDecoratorGenerator&body=https://github.com/DavidFineboym/LoggingDecoratorGenerator -46) [lucide-blazor]( https://github.com/brecht-vde/lucide-blazor/) , https://github.com/brecht-vde/lucide-blazor/ +45) [lucide-blazor]( https://github.com/brecht-vde/lucide-blazor/) , https://github.com/brecht-vde/lucide-blazor/ Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=lucide-blazor&body=https://github.com/brecht-vde/lucide-blazor/ -47) [ManagedDotnetProfiler]( https://github.com/kevingosse/ManagedDotnetProfiler) , https://github.com/kevingosse/ManagedDotnetProfiler +46) [ManagedDotnetProfiler]( https://github.com/kevingosse/ManagedDotnetProfiler) , https://github.com/kevingosse/ManagedDotnetProfiler Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=ManagedDotnetProfiler&body=https://github.com/kevingosse/ManagedDotnetProfiler -48) [Maui.BindableProperty.Generator]( https://github.com/rrmanzano/maui-bindableproperty-generator) , https://github.com/rrmanzano/maui-bindableproperty-generator +47) [Maui.BindableProperty.Generator]( https://github.com/rrmanzano/maui-bindableproperty-generator) , https://github.com/rrmanzano/maui-bindableproperty-generator Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=Maui.BindableProperty.Generator&body=https://github.com/rrmanzano/maui-bindableproperty-generator -49) [Minerals.AutoCQRS]( https://github.com/SzymonHalucha/Minerals.AutoCQRS) , https://github.com/SzymonHalucha/Minerals.AutoCQRS +48) [Minerals.AutoCQRS]( https://github.com/SzymonHalucha/Minerals.AutoCQRS) , https://github.com/SzymonHalucha/Minerals.AutoCQRS Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=Minerals.AutoCQRS&body=https://github.com/SzymonHalucha/Minerals.AutoCQRS -50) [Minerals.AutoDomain]( https://github.com/SzymonHalucha/Minerals.AutoDomain) , https://github.com/SzymonHalucha/Minerals.AutoDomain +49) [Minerals.AutoDomain]( https://github.com/SzymonHalucha/Minerals.AutoDomain) , https://github.com/SzymonHalucha/Minerals.AutoDomain Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=Minerals.AutoDomain&body=https://github.com/SzymonHalucha/Minerals.AutoDomain -51) [observable]( https://github.com/notanaverageman/Bindables) , https://github.com/notanaverageman/Bindables +50) [observable]( https://github.com/notanaverageman/Bindables) , https://github.com/notanaverageman/Bindables Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=observable&body=https://github.com/notanaverageman/Bindables -52) [PolySharp]( https://github.com/Sergio0694/PolySharp) , https://github.com/Sergio0694/PolySharp +51) [PolySharp]( https://github.com/Sergio0694/PolySharp) , https://github.com/Sergio0694/PolySharp Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=PolySharp&body=https://github.com/Sergio0694/PolySharp -53) [RazorGen]( https://github.com/dartk/RazorGen) , https://github.com/dartk/RazorGen +52) [RazorGen]( https://github.com/dartk/RazorGen) , https://github.com/dartk/RazorGen Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=RazorGen&body=https://github.com/dartk/RazorGen -54) [SerdeDn]( https://github.com/serdedotnet/serde) , https://github.com/serdedotnet/serde +53) [SerdeDn]( https://github.com/serdedotnet/serde) , https://github.com/serdedotnet/serde Why I have not tested : serializer. Done by MSFT with System.Text.Json https://github.com/ignatandrei/RSCG_Examples/issues/new?title=SerdeDn&body=https://github.com/serdedotnet/serde -55) [SogePoco]( https://github.com/d-p-y/SogePoco) , https://github.com/d-p-y/SogePoco +54) [SogePoco]( https://github.com/d-p-y/SogePoco) , https://github.com/d-p-y/SogePoco Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=SogePoco&body=https://github.com/d-p-y/SogePoco -56) [SourceCrafter.HttpServiceClientGenerator]( https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/) , https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ +55) [SourceCrafter.HttpServiceClientGenerator]( https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/) , https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=SourceCrafter.HttpServiceClientGenerator&body=https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ -57) [ST.NSwag.ServerSourceGenerator]( https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator) , https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator +56) [ST.NSwag.ServerSourceGenerator]( https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator) , https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=ST.NSwag.ServerSourceGenerator&body=https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator -58) [StrongInject]( https://github.com/YairHalberstadt/stronginject/) , https://github.com/YairHalberstadt/stronginject/ +57) [StrongInject]( https://github.com/YairHalberstadt/stronginject/) , https://github.com/YairHalberstadt/stronginject/ Why I have not tested : later https://github.com/ignatandrei/RSCG_Examples/issues/new?title=StrongInject&body=https://github.com/YairHalberstadt/stronginject/ -59) [TeuJson]( https://github.com/Terria-K/TeuJson) , https://github.com/Terria-K/TeuJson +58) [TeuJson]( https://github.com/Terria-K/TeuJson) , https://github.com/Terria-K/TeuJson Why I have not tested : json a class, was done in System.Text.Json https://github.com/ignatandrei/RSCG_Examples/issues/new?title=TeuJson&body=https://github.com/Terria-K/TeuJson -60) [Tinyhand]( https://github.com/archi-Doc/Tinyhand) , https://github.com/archi-Doc/Tinyhand +59) [Tinyhand]( https://github.com/archi-Doc/Tinyhand) , https://github.com/archi-Doc/Tinyhand Why I have not tested : tried, need documentation https://github.com/ignatandrei/RSCG_Examples/issues/new?title=Tinyhand&body=https://github.com/archi-Doc/Tinyhand -61) [TupleOverloadGenerator]( https://github.com/ProphetLamb/TupleOverloadGenerator) , https://github.com/ProphetLamb/TupleOverloadGenerator +60) [TupleOverloadGenerator]( https://github.com/ProphetLamb/TupleOverloadGenerator) , https://github.com/ProphetLamb/TupleOverloadGenerator Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=TupleOverloadGenerator&body=https://github.com/ProphetLamb/TupleOverloadGenerator -62) [TypealizR]( https://github.com/earloc/TypealizR) , https://github.com/earloc/TypealizR +61) [TypealizR]( https://github.com/earloc/TypealizR) , https://github.com/earloc/TypealizR Why I have not tested : depends on Microsoft.Extensions.Localization https://github.com/ignatandrei/RSCG_Examples/issues/new?title=TypealizR&body=https://github.com/earloc/TypealizR -63) [UnitTestBlazor]( https://github.com/bUnit-dev/bUnit) , https://github.com/bUnit-dev/bUnit +62) [UnitTestBlazor]( https://github.com/bUnit-dev/bUnit) , https://github.com/bUnit-dev/bUnit Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=UnitTestBlazor&body=https://github.com/bUnit-dev/bUnit -64) [ValueLink]( https://github.com/archi-Doc/ValueLink) , https://github.com/archi-Doc/ValueLink +63) [ValueLink]( https://github.com/archi-Doc/ValueLink) , https://github.com/archi-Doc/ValueLink Why I have not tested : too complicated https://github.com/ignatandrei/RSCG_Examples/issues/new?title=ValueLink&body=https://github.com/archi-Doc/ValueLink -65) [VisitorPatternGenerator]( https://github.com/hikarin522/VisitorPatternGenerator/) , https://github.com/hikarin522/VisitorPatternGenerator/ +64) [VisitorPatternGenerator]( https://github.com/hikarin522/VisitorPatternGenerator/) , https://github.com/hikarin522/VisitorPatternGenerator/ Why I have not tested : issue opened https://github.com/ignatandrei/RSCG_Examples/issues/new?title=VisitorPatternGenerator&body=https://github.com/hikarin522/VisitorPatternGenerator/ -66) [WrapperValueObject]( https://github.com/martinothamar/WrapperValueObject) , https://github.com/martinothamar/WrapperValueObject +65) [WrapperValueObject]( https://github.com/martinothamar/WrapperValueObject) , https://github.com/martinothamar/WrapperValueObject Why I have not tested : not maintained as in readme diff --git a/later.md b/later.md index 604d3a2e2..c787ce0c2 100644 --- a/later.md +++ b/later.md @@ -1,6 +1,6 @@ # Just later -## Latest Update : 2025-10-03 => 03 October 2025 +## Latest Update : 2025-10-04 => 04 October 2025 @@ -62,91 +62,85 @@ Why I have not tested : later -10) [https://github.com/hanachiru/RapidEnum]( https://github.com/hanachiru/RapidEnum) , https://github.com/hanachiru/RapidEnum +10) [https://github.com/Hookyns/validly]( https://github.com/Hookyns/validly) , https://github.com/Hookyns/validly Why I have not tested : later -11) [https://github.com/Hookyns/validly]( https://github.com/Hookyns/validly) , https://github.com/Hookyns/validly +11) [https://github.com/nuskey8/Csv-CSharp]( https://github.com/nuskey8/Csv-CSharp) , https://github.com/nuskey8/Csv-CSharp Why I have not tested : later -12) [https://github.com/nuskey8/Csv-CSharp]( https://github.com/nuskey8/Csv-CSharp) , https://github.com/nuskey8/Csv-CSharp +12) [https://github.com/pierre3/PlantUmlClassDiagramGenerator]( https://github.com/pierre3/PlantUmlClassDiagramGenerator) , https://github.com/pierre3/PlantUmlClassDiagramGenerator Why I have not tested : later -13) [https://github.com/pierre3/PlantUmlClassDiagramGenerator]( https://github.com/pierre3/PlantUmlClassDiagramGenerator) , https://github.com/pierre3/PlantUmlClassDiagramGenerator +13) [https://github.com/Stepami/visitor-net]( https://github.com/Stepami/visitor-net) , https://github.com/Stepami/visitor-net Why I have not tested : later -14) [https://github.com/Stepami/visitor-net]( https://github.com/Stepami/visitor-net) , https://github.com/Stepami/visitor-net +14) [https://github.com/SzymonHalucha/Minerals.AutoCommands]( https://github.com/SzymonHalucha/Minerals.AutoCommands) , https://github.com/SzymonHalucha/Minerals.AutoCommands Why I have not tested : later -15) [https://github.com/SzymonHalucha/Minerals.AutoCommands]( https://github.com/SzymonHalucha/Minerals.AutoCommands) , https://github.com/SzymonHalucha/Minerals.AutoCommands +15) [https://github.com/Teleopti/Saspect]( https://github.com/Teleopti/Saspect) , https://github.com/Teleopti/Saspect Why I have not tested : later -16) [https://github.com/Teleopti/Saspect]( https://github.com/Teleopti/Saspect) , https://github.com/Teleopti/Saspect +16) [Maui.BindableProperty.Generator]( https://github.com/rrmanzano/maui-bindableproperty-generator) , https://github.com/rrmanzano/maui-bindableproperty-generator Why I have not tested : later -17) [Maui.BindableProperty.Generator]( https://github.com/rrmanzano/maui-bindableproperty-generator) , https://github.com/rrmanzano/maui-bindableproperty-generator +17) [Minerals.AutoCQRS]( https://github.com/SzymonHalucha/Minerals.AutoCQRS) , https://github.com/SzymonHalucha/Minerals.AutoCQRS Why I have not tested : later -18) [Minerals.AutoCQRS]( https://github.com/SzymonHalucha/Minerals.AutoCQRS) , https://github.com/SzymonHalucha/Minerals.AutoCQRS +18) [Minerals.AutoDomain]( https://github.com/SzymonHalucha/Minerals.AutoDomain) , https://github.com/SzymonHalucha/Minerals.AutoDomain Why I have not tested : later -19) [Minerals.AutoDomain]( https://github.com/SzymonHalucha/Minerals.AutoDomain) , https://github.com/SzymonHalucha/Minerals.AutoDomain +19) [observable]( https://github.com/notanaverageman/Bindables) , https://github.com/notanaverageman/Bindables Why I have not tested : later -20) [observable]( https://github.com/notanaverageman/Bindables) , https://github.com/notanaverageman/Bindables +20) [RazorGen]( https://github.com/dartk/RazorGen) , https://github.com/dartk/RazorGen Why I have not tested : later -21) [RazorGen]( https://github.com/dartk/RazorGen) , https://github.com/dartk/RazorGen +21) [SourceCrafter.HttpServiceClientGenerator]( https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/) , https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ Why I have not tested : later -22) [SourceCrafter.HttpServiceClientGenerator]( https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/) , https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ +22) [ST.NSwag.ServerSourceGenerator]( https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator) , https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator Why I have not tested : later -23) [ST.NSwag.ServerSourceGenerator]( https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator) , https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator - -Why I have not tested : later - - - -24) [StrongInject]( https://github.com/YairHalberstadt/stronginject/) , https://github.com/YairHalberstadt/stronginject/ +23) [StrongInject]( https://github.com/YairHalberstadt/stronginject/) , https://github.com/YairHalberstadt/stronginject/ Why I have not tested : later diff --git a/v2/Generator/MultiGeneratorV2.cs b/v2/Generator/MultiGeneratorV2.cs index 92e61ae51..00946ab71 100644 --- a/v2/Generator/MultiGeneratorV2.cs +++ b/v2/Generator/MultiGeneratorV2.cs @@ -120,7 +120,9 @@ public string[] SourceNoRSCG() var text=await File.ReadAllTextAsync(nameFile); text = text.Replace("(docs/", $"({d.Generator!.Source}/docs/"); text = text.Replace("(img/", $"({d.Generator!.Source}/img/"); - text=text.Replace("(README_IMAGE.png)", $"({d.Generator!.Source}/README_IMAGE.png)"); + text = text.Replace("(./Images/", $"({d.Generator!.Source}/Images/"); + text = text.Replace("(README_IMAGE.png)", $"({d.Generator!.Source}/README_IMAGE.png)"); + text = text.Replace("[this]()", $"[this]({d.Generator!.Source})"); text = text.Replace("(README", $"({d.Generator!.Source}/README"); text = text.Replace("(integ-tests/", $"({d.Generator!.Source}/integ-tests/"); text = text.Replace("(./samples", $"({d.Generator!.Source}/samples"); diff --git a/v2/Generator/all.csv b/v2/Generator/all.csv index c79884b49..28f552748 100644 --- a/v2/Generator/all.csv +++ b/v2/Generator/all.csv @@ -232,3 +232,4 @@ Nr,Key,Source,Category 231,kli.Localize, https://github.com/kl1mm/localize,FilesToCode 232,ConsoleAppFramework, https://github.com/Cysharp/ConsoleAppFramework,Console 233,Vyaml, https://github.com/hadashiA/VYaml,Serializer +234,RapidEnum, https://github.com/hanachiru/RapidEnum,Enum diff --git a/v2/RSCGExamplesData/GeneratorDataRec.json b/v2/RSCGExamplesData/GeneratorDataRec.json index fb27e1f9f..5e687a65e 100644 --- a/v2/RSCGExamplesData/GeneratorDataRec.json +++ b/v2/RSCGExamplesData/GeneratorDataRec.json @@ -1408,5 +1408,11 @@ "Category":16, "dtStart": "2025-10-03T00:00:00", "show": true +}, +{ + "ID":"RapidEnum", + "Category":19, + "dtStart": "2025-10-04T00:00:00", + "show": true } ] \ No newline at end of file diff --git a/v2/RSCGExamplesData/NoExample.json b/v2/RSCGExamplesData/NoExample.json index cafcad46b..ef4feb993 100644 --- a/v2/RSCGExamplesData/NoExample.json +++ b/v2/RSCGExamplesData/NoExample.json @@ -881,11 +881,6 @@ "name":"https://github.com/Hookyns/validly", "why":"later" }, - { - "ID":227, - "name":"https://github.com/hanachiru/RapidEnum", - "why":"later" - }, { "ID":228, "name":"https://github.com/nuskey8/Csv-CSharp", diff --git a/v2/rscg_examples/RapidEnum/description.json b/v2/rscg_examples/RapidEnum/description.json new file mode 100644 index 000000000..47daa8492 --- /dev/null +++ b/v2/rscg_examples/RapidEnum/description.json @@ -0,0 +1,22 @@ +{ + "generator":{ + "name":"RapidEnum", + "nuget":[ + "https://www.nuget.org/packages/RapidEnum/" + ], + "link":"https://github.com/hanachiru/RapidEnum", + "author":"hanachiru", + "source":"https://github.com/hanachiru/RapidEnum" + }, + "data":{ + "goodFor":["Generate enum values without reflection"], + "csprojDemo":"EnumDemo.csproj", + "csFiles":["Program.cs","CarTypes.cs"], + "excludeDirectoryGenerated":[""], + "includeAdditionalFiles":[""] + }, + "links":{ + "blog":"", + "video":"" + } +} \ No newline at end of file diff --git a/v2/rscg_examples/RapidEnum/nuget.txt b/v2/rscg_examples/RapidEnum/nuget.txt new file mode 100644 index 000000000..ed5e8891b --- /dev/null +++ b/v2/rscg_examples/RapidEnum/nuget.txt @@ -0,0 +1 @@ +Enum utility with SourceGenerator for C#/.NET \ No newline at end of file diff --git a/v2/rscg_examples/RapidEnum/readme.txt b/v2/rscg_examples/RapidEnum/readme.txt new file mode 100644 index 000000000..b4d5b63bd --- /dev/null +++ b/v2/rscg_examples/RapidEnum/readme.txt @@ -0,0 +1,220 @@ +# RapidEnum + +[![nuget](https://img.shields.io/nuget/v/RapidEnum)](https://www.nuget.org/packages/RapidEnum) +[![Releases](https://img.shields.io/github/release/hanachiru/RapidEnum.svg)](https://github.com/hanachiru/RapidEnum/releases) +[![license](https://img.shields.io/badge/LICENSE-MIT-green.svg)](LICENSE) +[![test](https://github.com/hanachiru/RapidEnum/actions/workflows/test.yml/badge.svg)](https://github.com/hanachiru/RapidEnum/actions/workflows/test.yml) + +[日本語版](README.jp.md) + +RapidEnum is a Source Generator that provides fast-running enum utilities for C#/.NET. It is faster than the [.NET API](https://learn.microsoft.com/en-us/dotnet/api/system.enum?view=net-8.0) and achieves zero allocation for all methods. + +**Package - [RapidEnum](https://www.nuget.org/packages/RapidEnum)** + +![PerformanceComparison](./Images/PerformanceComparison.png) + +It performed better than .NET API. It is also faster than [FastEnum v1.8.0](https://github.com/xin9le/FastEnum/releases/tag/v1.8.0). For more information on performance comparisons, see [this](). + +RapidEnum is heavily influenced by [FastEnum](https://github.com/xin9le/FastEnum). API is very similar to FastEnum. Thanks to [xin9le](https://github.com/xin9le) for creating a great library! + +# Table of Contents + +- [Requirements](#Requirements) +- [Installation](#Installation) + - [NuGet](#NuGet) + - [Unity](#Unity) + - [asmdef settings](#asmdef-settings) +- [How to use](#How-to-use) + - [Basic usage](#Basic-usage) + - [How to use it for any enum](#How-to-use-it-for-any-enum) + - [Get Name and Value as a pair](#Get-Name-and-Value-as-a-pair) + - [Use EnumMemberAttribute](#Use-EnumMemberAttribute) +- [Performance comparison](#Performance-comparison) + +# Requirements + +- .NET Standard2.0 or newer +- Unity 2022.3.12f1 or newer + +# Installation + +## NuGet + +```shell +$ dotnet add package RapidEnum +``` + +**nuget.org : [RapidEnum](https://www.nuget.org/packages/RapidEnum)** + +## Unity + +Add the following git URL from the Package Manager + +``` +https://github.com/hanachiru/RapidEnum.git?path=/RapidEnum.Unity/Packages/com.hanachiru.rapidenum +``` + +![UPM](./Images/UPM.png) + +### asmdef settings +If you have created a `.asmdef`, you need to add `RapidEnum` to the Assembly Definition References. + + + +# How to use + +## Basic usage + +Attaching `[RapidEnum]` to the target enum generates an enum utility class. Note that this is only valid for `public` or `internal` enum. + +```csharp +[RapidEnum] +public enum Weather +{ + Sun, + Cloud, + Rain, + Snow +} +``` + +The `Enum name + EnumExtensions` class defines the relevant methods. + +```csharp +// Sun,Cloud,Rain,Snow +IReadOnlyList values = WeatherEnumExtensions.GetValues(); + +// Sun,Cloud,Rain,Snow +IReadOnlyList names = WeatherEnumExtensions.GetNames(); + +// Rain +string name = WeatherEnumExtensions.GetName(Weather.Rain); + +// Cloud +string str = Weather.Cloud.ToStringFast(); + +// True +bool defined = WeatherEnumExtensions.IsDefined("Sun"); + +// Sun +Weather parse = WeatherEnumExtensions.Parse("Sun"); + +// True +// Sun +bool tryParse = WeatherEnumExtensions.TryParse("Sun", out Weather value); +``` + +## How to use it for any enum + +The `[RapidEnumWithType]` can be used to generate utility classes for any enum. + +For `static partial class` that are `public` or `internal`, give them a `[RapidEnumWithType]` with the target enum as an argument. The class name can be any string, but `Enum name + EnumExtensions` is easier to understand. + +```csharp +// System.DateTimeKind has Unspecified, Utc, Local +[RapidEnumWithType(typeof(DateTimeKind))] +public static partial class DateTimeKindEnumExtensions +{ +} +``` + +There is no performance difference compared to using `[RapidEnum]`. Use `[RapidEnumWithType]` if `[RapidEnum]` cannot be given, such as an enum provided by a third-party library. + +```csharp +// Unspecified,Utc,Local +IReadOnlyList values = DateTimeKindEnumExtensions.GetValues(); + +// Unspecified,Utc,Local +IReadOnlyList names = DateTimeKindEnumExtensions.GetNames(); + +// Local +string name = DateTimeKindEnumExtensions.GetName(DateTimeKind.Local); + +// Local +string str = DateTimeKind.Local.ToStringFast(); + +// True +bool defined = DateTimeKindEnumExtensions.IsDefined("Local"); + +// Local +DateTimeKind parse = DateTimeKindEnumExtensions.Parse("Local"); + +// True +// Local +bool tryParse = DateTimeKindEnumExtensions.TryParse("Local", out DateTimeKind value); +``` + +## Get Name and Value as a pair + +Use the `GetMembers` and `GetMember` methods if you want to get the Name and Value of enum in pairs. + +```csharp +WeatherEnumExtensions.Member member = WeatherEnumExtensions.GetMember(Weather.Rain); +var (name, value) = member; + +foreach (WeatherEnumExtensions.Member item in WeatherEnumExtensions.GetMembers()) +{ + Console.WriteLine($"Name : {item.Name}, Value : {item.Value}"); +} +``` + +## Use EnumMemberAttribute +If you use [EnumMemberAttribute](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.enummemberattribute?view=net-9.0), you can get the Value property of EnumMemberAttribute. +```csharp +[RapidEnum] +public enum Weather +{ + [EnumMember(Value = "sun")] + Sun, + [EnumMember] + Cloud, + [EnumMember(Value = "rain")] + Rain, + Snow +} +``` +```csharp +// sun +string enumMemberValue = Weather.Sun.GetEnumMemberValue(); + +// null +string enumMemberValue = Weather.Cloud.GetEnumMemberValue(); +``` + +# Performance comparison + +| Method | Mean | Error | StdDev | Median | Gen0 | Allocated | +| ------------------- | ---------: | --------: | --------: | ---------: | -----: | --------: | +| RapidEnum_GetValues | 0.0042 ns | 0.0059 ns | 0.0052 ns | 0.0028 ns | - | - | +| FastEnum_GetValues | 0.0083 ns | 0.0086 ns | 0.0081 ns | 0.0055 ns | - | - | +| NET_GetValues | 64.4620 ns | 0.9908 ns | 0.9268 ns | 64.2767 ns | 0.0048 | 40 B | +| RapidEnum_GetNames | 0.0006 ns | 0.0017 ns | 0.0015 ns | 0.0000 ns | - | - | +| FastEnum_GetNames | 0.0025 ns | 0.0031 ns | 0.0028 ns | 0.0012 ns | - | - | +| NET_GetNames | 12.3820 ns | 0.1086 ns | 0.1016 ns | 12.4076 ns | 0.0067 | 56 B | +| RapidEnum_GetName | 0.0069 ns | 0.0085 ns | 0.0071 ns | 0.0039 ns | - | - | +| FastEnum_GetName | 0.2530 ns | 0.0070 ns | 0.0065 ns | 0.2527 ns | - | - | +| NET_GetName | 15.9190 ns | 0.0524 ns | 0.0490 ns | 15.9046 ns | 0.0029 | 24 B | +| RapidEnum_ToString | 0.0103 ns | 0.0049 ns | 0.0046 ns | 0.0110 ns | - | - | +| FastEnum_ToString | 0.4844 ns | 0.0062 ns | 0.0052 ns | 0.4845 ns | - | - | +| NET_ToString | 6.1700 ns | 0.0451 ns | 0.0376 ns | 6.1493 ns | 0.0029 | 24 B | +| RapidEnum_IsDefines | 0.0026 ns | 0.0036 ns | 0.0034 ns | 0.0000 ns | - | - | +| FastEnum_IsDefines | 4.6724 ns | 0.0583 ns | 0.0545 ns | 4.6434 ns | - | - | +| NET_IsDefines | 14.5923 ns | 0.0355 ns | 0.0332 ns | 14.5996 ns | - | - | +| RapidEnum_Parse | 0.9258 ns | 0.0161 ns | 0.0150 ns | 0.9240 ns | - | - | +| FastEnum_Parse | 4.6223 ns | 0.0082 ns | 0.0073 ns | 4.6192 ns | - | - | +| NET_Parse | 8.8707 ns | 0.0965 ns | 0.0903 ns | 8.8293 ns | - | - | +| RapidEnum_TryParse | 0.7633 ns | 0.0097 ns | 0.0090 ns | 0.7657 ns | - | - | +| FastEnum_TryParse | 4.6869 ns | 0.0254 ns | 0.0212 ns | 4.6852 ns | - | - | +| NET_TryParse | 8.8433 ns | 0.0609 ns | 0.0569 ns | 8.8268 ns | - | - | + +![PerformanceComparison](./Images/PerformanceComparison.png) + +[Benchmark Source](https://github.com/hanachiru/RapidEnum/tree/main/RapidEnum.Benchmark) + +``` +BenchmarkDotNet v0.14.0, macOS Sonoma 14.4.1 (23E224) [Darwin 23.4.0] +Apple M2 Pro, 1 CPU, 12 logical and 12 physical cores +.NET SDK 8.0.303 +[Host] : .NET 8.0.7 (8.0.724.31311), Arm64 RyuJIT AdvSIMD +DefaultJob : .NET 8.0.7 (8.0.724.31311), Arm64 RyuJIT AdvSIMD +``` diff --git a/v2/rscg_examples/RapidEnum/src/.tours/RapidEnum.tour b/v2/rscg_examples/RapidEnum/src/.tours/RapidEnum.tour new file mode 100644 index 000000000..40e199258 --- /dev/null +++ b/v2/rscg_examples/RapidEnum/src/.tours/RapidEnum.tour @@ -0,0 +1,42 @@ + +{ + "$schema": "https://aka.ms/codetour-schema", + "title": "RapidEnum", + "steps": + [ + { + "file": "EnumDemo/EnumDemo.csproj", + "description": "First, we add Nuget [RapidEnum](https://www.nuget.org/packages/RapidEnum/) in csproj ", + "pattern": "RapidEnum" + } + + ,{ + "file": "EnumDemo/CarTypes.cs", + "description": "File CarTypes.cs ", + "pattern": "this is the code" + } + + ,{ + "file": "EnumDemo/Program.cs", + "description": "File Program.cs \r\n>> dotnet run --project EnumDemo/EnumDemo.csproj ", + "pattern": "this is the code" + } + + + ,{ + "file": "EnumDemo/obj/GX/RapidEnum.Generators/RapidEnum.RapidEnumGenerator/RapidEnumAttributes.g.cs", + "description": "Generated File 2 from 2 : RapidEnumAttributes.g.cs ", + "line": 1 + } + + ,{ + "file": "EnumDemo/obj/GX/RapidEnum.Generators/RapidEnum.RapidEnumGenerator/CarTypesEnumExtensions.g.cs", + "description": "Generated File 1 from 2 : CarTypesEnumExtensions.g.cs ", + "line": 1 + } + + ], + + "ref": "main" + +} \ No newline at end of file diff --git a/v2/rscg_examples/RapidEnum/src/EnumDemo.sln b/v2/rscg_examples/RapidEnum/src/EnumDemo.sln new file mode 100644 index 000000000..ace1b5ec0 --- /dev/null +++ b/v2/rscg_examples/RapidEnum/src/EnumDemo.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36401.2 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnumDemo", "EnumDemo\EnumDemo.csproj", "{9D8848B1-F882-46F9-8036-C1C47BA503F0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9D8848B1-F882-46F9-8036-C1C47BA503F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9D8848B1-F882-46F9-8036-C1C47BA503F0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9D8848B1-F882-46F9-8036-C1C47BA503F0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9D8848B1-F882-46F9-8036-C1C47BA503F0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {420BBB7E-4EC0-4A41-98F7-E573A6501983} + EndGlobalSection +EndGlobal diff --git a/v2/rscg_examples/RapidEnum/src/EnumDemo/CarTypes.cs b/v2/rscg_examples/RapidEnum/src/EnumDemo/CarTypes.cs new file mode 100644 index 000000000..625d44f24 --- /dev/null +++ b/v2/rscg_examples/RapidEnum/src/EnumDemo/CarTypes.cs @@ -0,0 +1,11 @@ + +namespace EnumDemo; +[RapidEnum.RapidEnum] +public enum CarTypes +{ + None, + Dacia , + Tesla , + BMW , + Mercedes , +} diff --git a/v2/rscg_examples/RapidEnum/src/EnumDemo/EnumDemo.csproj b/v2/rscg_examples/RapidEnum/src/EnumDemo/EnumDemo.csproj new file mode 100644 index 000000000..048a0c0ed --- /dev/null +++ b/v2/rscg_examples/RapidEnum/src/EnumDemo/EnumDemo.csproj @@ -0,0 +1,19 @@ + + + + Exe + net9.0 + enable + enable + + + + true + $(BaseIntermediateOutputPath)\GX + + + + + + + diff --git a/v2/rscg_examples/RapidEnum/src/EnumDemo/Program.cs b/v2/rscg_examples/RapidEnum/src/EnumDemo/Program.cs new file mode 100644 index 000000000..bd25ecf06 --- /dev/null +++ b/v2/rscg_examples/RapidEnum/src/EnumDemo/Program.cs @@ -0,0 +1,10 @@ +// See https://aka.ms/new-console-template for more information +using EnumDemo; + +Console.WriteLine("Hello, World!"); +Console.WriteLine("Car types:" + CarTypesEnumExtensions.GetValues().Count); +var cars = CarTypesEnumExtensions.GetValues(); +foreach (var car in cars) +{ + Console.WriteLine(car.ToStringFast()); +} \ No newline at end of file diff --git a/v2/rscg_examples/RapidEnum/video.json b/v2/rscg_examples/RapidEnum/video.json new file mode 100644 index 000000000..8206ec0c9 --- /dev/null +++ b/v2/rscg_examples/RapidEnum/video.json @@ -0,0 +1,39 @@ +{ + "scriptName": "RapidEnum", + "steps": +[ + {"typeStep":"exec","arg":"clipchamp.exe launch"}, + {"typeStep":"text","arg": "Welcome to Roslyn Examples"}, + {"typeStep":"text","arg":"If you want to see more examples , see List Of RSCG"}, + {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG"}, + {"typeStep":"text","arg": "My name is Andrei Ignat and I am deeply fond of Roslyn Source Code Generator. "}, + +{"typeStep":"text","arg": "Today I will present RapidEnum . Generate enum values without reflection ."}, +{"typeStep":"browser","arg":"https://www.nuget.org/packages/RapidEnum/"}, +{"typeStep":"text","arg": "The whole example is here"}, +{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/RapidEnum"}, +{"typeStep":"text","arg": "You can download the code from here"}, +{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/RapidEnum#download-example-net--c-"}, +{"typeStep":"text","arg":"Here is the code downloaded "}, +{"typeStep":"exec","arg":"explorer.exe /select,D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\RapidEnum\\src\\EnumDemo.sln"}, +{"typeStep":"text","arg": "So , let's start the project with Visual Studio Code "}, +{"typeStep":"stepvscode","arg": "-n D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\RapidEnum\\src"}, + +{"typeStep":"text","arg": "To use it ,you will put the Nuget RapidEnum into the csproj "}, + +{"typeStep":"stepvscode","arg": "-r -g D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\RapidEnum\\src\\EnumDemo\\EnumDemo.csproj"}, + +{"typeStep":"text","arg": "And now I will show you an example of using RapidEnum"}, + +{"typeStep":"hide","arg": "now execute the tour in VSCode"}, +{"typeStep":"tour", "arg": "src/.tours/"}, +{"typeStep":"text","arg":" And I will execute the project"}, +{"typeStep":"showproj", "arg":"EnumDemo.csproj"}, +{"typeStep":"text","arg":" This concludes the project"}, +{"typeStep":"waitseconds","arg":"30"}, +{"typeStep":"text","arg": "Remember, you can download the code from here"}, +{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/RapidEnum#download-example-net--c-", +SpeakTest=" "}, +{"typeStep":"waitseconds","arg":"30"}, +] +} diff --git a/v2/rscg_examples_site/docs/Categories/Enum.md b/v2/rscg_examples_site/docs/Categories/Enum.md index fad19917b..c9417d135 100644 --- a/v2/rscg_examples_site/docs/Categories/Enum.md +++ b/v2/rscg_examples_site/docs/Categories/Enum.md @@ -1,6 +1,6 @@

Enum

-Number RSCG: 11 +Number RSCG: 12 1 [CredFetoEnum](/docs/CredFetoEnum) @@ -22,5 +22,7 @@ Number RSCG: 11 10 [PMart.Enumeration](/docs/PMart.Enumeration) - 11 [requiredenum](/docs/requiredenum) + 11 [RapidEnum](/docs/RapidEnum) + + 12 [requiredenum](/docs/requiredenum) \ No newline at end of file diff --git a/v2/rscg_examples_site/docs/Categories/_PrimitiveEnum.mdx b/v2/rscg_examples_site/docs/Categories/_PrimitiveEnum.mdx index 6229baad7..d77e14dea 100644 --- a/v2/rscg_examples_site/docs/Categories/_PrimitiveEnum.mdx +++ b/v2/rscg_examples_site/docs/Categories/_PrimitiveEnum.mdx @@ -20,7 +20,9 @@ 10 [PMart.Enumeration](/docs/PMart.Enumeration) - 11 [requiredenum](/docs/requiredenum) + 11 [RapidEnum](/docs/RapidEnum) + + 12 [requiredenum](/docs/requiredenum) ### See category diff --git a/v2/rscg_examples_site/docs/NoExamples.md b/v2/rscg_examples_site/docs/NoExamples.md index cfed64b73..070cfe60b 100644 --- a/v2/rscg_examples_site/docs/NoExamples.md +++ b/v2/rscg_examples_site/docs/NoExamples.md @@ -302,419 +302,415 @@ Why I have not put example: later Why I have not put example: issue opened -75)https://github.com/hanachiru/RapidEnum https://github.com/hanachiru/RapidEnum +75)https://github.com/Hookyns/validly https://github.com/Hookyns/validly Why I have not put example: later -76)https://github.com/Hookyns/validly https://github.com/Hookyns/validly - -Why I have not put example: later - -77)https://github.com/inputfalken/Dynatello https://github.com/inputfalken/Dynatello +76)https://github.com/inputfalken/Dynatello https://github.com/inputfalken/Dynatello Why I have not put example: too complicated -78)https://github.com/ionite34/MinimalApiMapper https://github.com/ionite34/MinimalApiMapper +77)https://github.com/ionite34/MinimalApiMapper https://github.com/ionite34/MinimalApiMapper Why I have not put example: own idea where to generate files, so overwrites -79)https://github.com/JasonBock/CslaGeneratorSerialization https://github.com/JasonBock/CslaGeneratorSerialization +78)https://github.com/JasonBock/CslaGeneratorSerialization https://github.com/JasonBock/CslaGeneratorSerialization Why I have not put example: too complicated -80)https://github.com/nevsnirG/MinimalRichDomain https://github.com/nevsnirG/MinimalRichDomain +79)https://github.com/nevsnirG/MinimalRichDomain https://github.com/nevsnirG/MinimalRichDomain Why I have not put example: old ISourceGenerator -81)https://github.com/nuskey8/Csv-CSharp https://github.com/nuskey8/Csv-CSharp +80)https://github.com/nuskey8/Csv-CSharp https://github.com/nuskey8/Csv-CSharp Why I have not put example: later -82)https://github.com/OrgEleCho/EleCho.Internationalization https://github.com/OrgEleCho/EleCho.Internationalization +81)https://github.com/OrgEleCho/EleCho.Internationalization https://github.com/OrgEleCho/EleCho.Internationalization Why I have not put example: issue opened -83)https://github.com/pierre3/PlantUmlClassDiagramGenerator https://github.com/pierre3/PlantUmlClassDiagramGenerator +82)https://github.com/pierre3/PlantUmlClassDiagramGenerator https://github.com/pierre3/PlantUmlClassDiagramGenerator Why I have not put example: later -84)https://github.com/ramhari-dev/PropGenAoT https://github.com/ramhari-dev/PropGenAoT +83)https://github.com/ramhari-dev/PropGenAoT https://github.com/ramhari-dev/PropGenAoT Why I have not put example: no readme -85)https://github.com/stbychkov/AutoLoggerMessage https://github.com/stbychkov/AutoLoggerMessage +84)https://github.com/stbychkov/AutoLoggerMessage https://github.com/stbychkov/AutoLoggerMessage Why I have not put example: Microsoft have done same feature -86)https://github.com/Stepami/visitor-net https://github.com/Stepami/visitor-net +85)https://github.com/Stepami/visitor-net https://github.com/Stepami/visitor-net Why I have not put example: later -87)https://github.com/svee4/RequiredStaticMembers https://github.com/svee4/RequiredStaticMembers +86)https://github.com/svee4/RequiredStaticMembers https://github.com/svee4/RequiredStaticMembers Why I have not put example: issue opened -88)https://github.com/SzymonHalucha/Minerals.AutoCommands https://github.com/SzymonHalucha/Minerals.AutoCommands +87)https://github.com/SzymonHalucha/Minerals.AutoCommands https://github.com/SzymonHalucha/Minerals.AutoCommands Why I have not put example: later -89)https://github.com/Teleopti/Saspect https://github.com/Teleopti/Saspect +88)https://github.com/Teleopti/Saspect https://github.com/Teleopti/Saspect Why I have not put example: later -90)https://github.com/TheFo2sh/AsyncFlow https://github.com/TheFo2sh/AsyncFlow +89)https://github.com/TheFo2sh/AsyncFlow https://github.com/TheFo2sh/AsyncFlow Why I have not put example: too complicated -91)https://github.com/wieslawsoltes/ReactiveGenerator https://github.com/wieslawsoltes/ReactiveGenerator +90)https://github.com/wieslawsoltes/ReactiveGenerator https://github.com/wieslawsoltes/ReactiveGenerator Why I have not put example: too complicated -92)HubClientProxyGenerator https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR.Client.SourceGenerator +91)HubClientProxyGenerator https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR.Client.SourceGenerator Why I have not put example: not having nuget, but having IIncrementalGenerator -93)Imp.NET https://github.com/DouglasDwyer/Imp.NET +92)Imp.NET https://github.com/DouglasDwyer/Imp.NET Why I have not put example: old ISourceGenerator -94)Intellenum https://github.com/SteveDunn/Intellenum +93)Intellenum https://github.com/SteveDunn/Intellenum Why I have not put example: not understand how to use -95)InterfaceGenerator https://github.com/daver32/InterfaceGenerator +94)InterfaceGenerator https://github.com/daver32/InterfaceGenerator Why I have not put example: old ISourceGenerator -96)IoTHubClientGenerator https://github.com/alonf/IoTHubClientGenerator +95)IoTHubClientGenerator https://github.com/alonf/IoTHubClientGenerator Why I have not put example: old ISourceGenerator -97)JsonByExampleGenerator https://github.com/hermanussen/JsonByExampleGenerator +96)JsonByExampleGenerator https://github.com/hermanussen/JsonByExampleGenerator Why I have not put example: old ISourceGenerator -98)JsonDeserializeResourceSourceGenerator https://github.com/musictopia2/JsonDeserializeResourceSourceGenerator +97)JsonDeserializeResourceSourceGenerator https://github.com/musictopia2/JsonDeserializeResourceSourceGenerator Why I have not put example: no readme -99)JsonMergePatch https://github.com/ladeak/JsonMergePatch +98)JsonMergePatch https://github.com/ladeak/JsonMergePatch Why I have not put example: old ISourceGenerator -100)JsonSerializerContextGenerator https://github.com/musictopia2/JsonSerializerContextGenerator +99)JsonSerializerContextGenerator https://github.com/musictopia2/JsonSerializerContextGenerator Why I have not put example: no readme -101)JsonSourceGenerator https://github.com/Pilchie/JsonSourceGenerator +100)JsonSourceGenerator https://github.com/Pilchie/JsonSourceGenerator Why I have not put example: not having nuget, but having IIncrementalGenerator -102)JsonSrcGen https://github.com/trampster/JsonSrcGen +101)JsonSrcGen https://github.com/trampster/JsonSrcGen Why I have not put example: old ISourceGenerator -103)kli.Localize https://github.com/kl1mm/localize +102)kli.Localize https://github.com/kl1mm/localize Why I have not put example: old ISourceGenerator -104)laker https://github.com/Lakerfield/Lakerfield.Rpc +103)laker https://github.com/Lakerfield/Lakerfield.Rpc Why I have not put example: too complicated -105)lambdajection https://github.com/cythral/lambdajection +104)lambdajection https://github.com/cythral/lambdajection Why I have not put example: old ISourceGenerator -106)Lazysh https://github.com/B1Z0N/LazyshGen +105)Lazysh https://github.com/B1Z0N/LazyshGen Why I have not put example: old ISourceGenerator -107)LoggingDecoratorGenerator https://github.com/DavidFineboym/LoggingDecoratorGenerator +106)LoggingDecoratorGenerator https://github.com/DavidFineboym/LoggingDecoratorGenerator Why I have not put example: Microsoft have done same feature -108)lucide-blazor https://github.com/brecht-vde/lucide-blazor/ +107)lucide-blazor https://github.com/brecht-vde/lucide-blazor/ Why I have not put example: issue opened -109)ManagedDotnetProfiler https://github.com/kevingosse/ManagedDotnetProfiler +108)ManagedDotnetProfiler https://github.com/kevingosse/ManagedDotnetProfiler Why I have not put example: too complicated -110)MapDataReader https://github.com/jitbit/MapDataReader +109)MapDataReader https://github.com/jitbit/MapDataReader Why I have not put example: old ISourceGenerator -111)MappingCloningExtensions https://github.com/musictopia2/MappingCloningExtensions +110)MappingCloningExtensions https://github.com/musictopia2/MappingCloningExtensions Why I have not put example: no readme -112)Maui.BindableProperty.Generator https://github.com/rrmanzano/maui-bindableproperty-generator +111)Maui.BindableProperty.Generator https://github.com/rrmanzano/maui-bindableproperty-generator Why I have not put example: later -113)MediatR https://github.com/Burgyn/MMLib.MediatR.Generators +112)MediatR https://github.com/Burgyn/MMLib.MediatR.Generators Why I have not put example: old ISourceGenerator -114)MemberAccessGenerator https://github.com/ufcpp/MemberAccessGenerator +113)MemberAccessGenerator https://github.com/ufcpp/MemberAccessGenerator Why I have not put example: old ISourceGenerator -115)MemoizeSourceGenerator https://github.com/Zoxive/MemoizeSourceGenerator +114)MemoizeSourceGenerator https://github.com/Zoxive/MemoizeSourceGenerator Why I have not put example: old ISourceGenerator -116)Minerals.AutoCQRS https://github.com/SzymonHalucha/Minerals.AutoCQRS +115)Minerals.AutoCQRS https://github.com/SzymonHalucha/Minerals.AutoCQRS Why I have not put example: later -117)Minerals.AutoDomain https://github.com/SzymonHalucha/Minerals.AutoDomain +116)Minerals.AutoDomain https://github.com/SzymonHalucha/Minerals.AutoDomain Why I have not put example: later -118)MiniRazor https://github.com/Tyrrrz/MiniRazor/ +117)MiniRazor https://github.com/Tyrrrz/MiniRazor/ Why I have not put example: archived -119)MockableStaticGenerator https://github.com/HamedFathi/MockableStaticGenerator +118)MockableStaticGenerator https://github.com/HamedFathi/MockableStaticGenerator Why I have not put example: old ISourceGenerator -120)MockGen https://github.com/thomas-girotto/MockGen +119)MockGen https://github.com/thomas-girotto/MockGen Why I have not put example: old ISourceGenerator -121)MockSourceGenerator https://github.com/hermanussen/MockSourceGenerator +120)MockSourceGenerator https://github.com/hermanussen/MockSourceGenerator Why I have not put example: old ISourceGenerator -122)MrMeeseeks.DIE https://github.com/Yeah69/MrMeeseeks.DIE +121)MrMeeseeks.DIE https://github.com/Yeah69/MrMeeseeks.DIE Why I have not put example: old ISourceGenerator -123)MrMeeseeks.ResXToViewModelGenerator https://github.com/Yeah69/MrMeeseeks.ResXToViewModelGenerator +122)MrMeeseeks.ResXToViewModelGenerator https://github.com/Yeah69/MrMeeseeks.ResXToViewModelGenerator Why I have not put example: old ISourceGenerator -124)MrMeeseeks.StaticDelegateGenerator https://github.com/Yeah69/MrMeeseeks.StaticDelegateGenerator +123)MrMeeseeks.StaticDelegateGenerator https://github.com/Yeah69/MrMeeseeks.StaticDelegateGenerator Why I have not put example: old ISourceGenerator -125)MrMeeseeks.Visitor https://github.com/Yeah69/MrMeeseeks.Visitor +124)MrMeeseeks.Visitor https://github.com/Yeah69/MrMeeseeks.Visitor Why I have not put example: old ISourceGenerator -126)Neon.Roslyn https://www.nuget.org/packages/Neon.Roslyn +125)Neon.Roslyn https://www.nuget.org/packages/Neon.Roslyn Why I have not put example: old ISourceGenerator -127)net_automatic_interface https://github.com/codecentric/net_automatic_interface +126)net_automatic_interface https://github.com/codecentric/net_automatic_interface Why I have not put example: old ISourceGenerator -128)NSourceGenerators https://github.com/NeVeSpl/NSourceGenerators/ +127)NSourceGenerators https://github.com/NeVeSpl/NSourceGenerators/ Why I have not put example: old ISourceGenerator -129)observable https://github.com/notanaverageman/Bindables +128)observable https://github.com/notanaverageman/Bindables Why I have not put example: later -130)Pipelines https://github.com/DumplingsDevs/Pipelines/ +129)Pipelines https://github.com/DumplingsDevs/Pipelines/ Why I have not put example: old ISourceGenerator -131)Plastic https://github.com/sang-hyeon/Plastic +130)Plastic https://github.com/sang-hyeon/Plastic Why I have not put example: old ISourceGenerator -132)PolySharp https://github.com/Sergio0694/PolySharp +131)PolySharp https://github.com/Sergio0694/PolySharp Why I have not put example: too complicated -133)PrimaryConstructor https://github.com/chaowlert/PrimaryConstructor +132)PrimaryConstructor https://github.com/chaowlert/PrimaryConstructor Why I have not put example: old ISourceGenerator -134)PrimitiveStaticDataGenerator https://github.com/iiweis/PrimitiveStaticDataGenerator +133)PrimitiveStaticDataGenerator https://github.com/iiweis/PrimitiveStaticDataGenerator Why I have not put example: old ISourceGenerator -135)PrintMembersGenerator https://github.com/Youssef1313/PrintMembersGenerator +134)PrintMembersGenerator https://github.com/Youssef1313/PrintMembersGenerator Why I have not put example: old ISourceGenerator -136)ProxyInterfaceGenerator https://github.com/StefH/ProxyInterfaceSourceGenerator +135)ProxyInterfaceGenerator https://github.com/StefH/ProxyInterfaceSourceGenerator Why I have not put example: old ISourceGenerator -137)PureHDF https://github.com/Apollo3zehn/PureHDF +136)PureHDF https://github.com/Apollo3zehn/PureHDF Why I have not put example: old ISourceGenerator -138)RazorGen https://github.com/dartk/RazorGen +137)RazorGen https://github.com/dartk/RazorGen Why I have not put example: later -139)RazorPageRouteGenerator https://github.com/surgicalcoder/RazorPageRouteGenerator +138)RazorPageRouteGenerator https://github.com/surgicalcoder/RazorPageRouteGenerator Why I have not put example: old ISourceGenerator -140)ReForge.Union https://github.com/nalcorso/ReForge.Union +139)ReForge.Union https://github.com/nalcorso/ReForge.Union Why I have not put example: not having nuget, but having IIncrementalGenerator -141)RoslynWeave https://github.com/Jishun/RoslynWeave +140)RoslynWeave https://github.com/Jishun/RoslynWeave Why I have not put example: old ISourceGenerator -142)ScenarioTests https://github.com/koenbeuk/ScenarioTests +141)ScenarioTests https://github.com/koenbeuk/ScenarioTests Why I have not put example: old ISourceGenerator -143)SerdeDn https://github.com/serdedotnet/serde +142)SerdeDn https://github.com/serdedotnet/serde Why I have not put example: serializer. Done by MSFT with System.Text.Json -144)SmallSharp https://github.com/devlooped/SmallSharp +143)SmallSharp https://github.com/devlooped/SmallSharp Why I have not put example: old ISourceGenerator -145)SmartAnnotations https://github.com/fiseni/SmartAnnotations +144)SmartAnnotations https://github.com/fiseni/SmartAnnotations Why I have not put example: old ISourceGenerator -146)SogePoco https://github.com/d-p-y/SogePoco +145)SogePoco https://github.com/d-p-y/SogePoco Why I have not put example: too complicated -147)SourceApi https://github.com/alekshura/SourceApi +146)SourceApi https://github.com/alekshura/SourceApi Why I have not put example: old ISourceGenerator -148)SourceConfig https://github.com/alekshura/SourceConfig +147)SourceConfig https://github.com/alekshura/SourceConfig Why I have not put example: old ISourceGenerator -149)SourceCrafter.HttpServiceClientGenerator https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ +148)SourceCrafter.HttpServiceClientGenerator https://github.com/pedro-gilmora/SourceCrafter.HttpServiceClientGenerator/ Why I have not put example: later -150)SourceGeneratorQuery https://github.com/roeibajayo/SourceGeneratorQuery +149)SourceGeneratorQuery https://github.com/roeibajayo/SourceGeneratorQuery Why I have not put example: old ISourceGenerator -151)SourceInject https://github.com/giggio/sourceinject/ +150)SourceInject https://github.com/giggio/sourceinject/ Why I have not put example: old ISourceGenerator -152)SourceMapper https://github.com/alekshura/SourceMapper +151)SourceMapper https://github.com/alekshura/SourceMapper Why I have not put example: old ISourceGenerator -153)SourceMapper https://github.com/paiden/SourceMapper/ +152)SourceMapper https://github.com/paiden/SourceMapper/ Why I have not put example: old ISourceGenerator -154)SqlMarshal https://github.com/kant2002/SqlMarshal +153)SqlMarshal https://github.com/kant2002/SqlMarshal Why I have not put example: old ISourceGenerator -155)ST.NSwag.ServerSourceGenerator https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator +154)ST.NSwag.ServerSourceGenerator https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator Why I have not put example: later -156)StackXML https://github.com/ZingBallyhoo/StackXML +155)StackXML https://github.com/ZingBallyhoo/StackXML Why I have not put example: old ISourceGenerator -157)StaticProxyGenerator https://github.com/robertturner/StaticProxyGenerator +156)StaticProxyGenerator https://github.com/robertturner/StaticProxyGenerator Why I have not put example: old ISourceGenerator -158)StrongInject https://github.com/YairHalberstadt/stronginject/ +157)StrongInject https://github.com/YairHalberstadt/stronginject/ Why I have not put example: later -159)StronglyTypedEmbeddedResources https://github.com/surgicalcoder/StronglyTypedEmbeddedResources +158)StronglyTypedEmbeddedResources https://github.com/surgicalcoder/StronglyTypedEmbeddedResources Why I have not put example: old ISourceGenerator -160)StructPacker https://github.com/RudolfKurka/StructPacker +159)StructPacker https://github.com/RudolfKurka/StructPacker Why I have not put example: old ISourceGenerator -161)Svg https://github.com/wieslawsoltes/Svg.Skia +160)Svg https://github.com/wieslawsoltes/Svg.Skia Why I have not put example: old ISourceGenerator -162)tecli https://github.com/tyevco/TeCLI +161)tecli https://github.com/tyevco/TeCLI Why I have not put example: old ISourceGenerator -163)TeuJson https://github.com/Terria-K/TeuJson +162)TeuJson https://github.com/Terria-K/TeuJson Why I have not put example: json a class, was done in System.Text.Json -164)Thunderboltloc https://github.com/AlyElhaddad/ThunderboltIoc +163)Thunderboltloc https://github.com/AlyElhaddad/ThunderboltIoc Why I have not put example: old ISourceGenerator -165)Tinyhand https://github.com/archi-Doc/Tinyhand +164)Tinyhand https://github.com/archi-Doc/Tinyhand Why I have not put example: tried, need documentation -166)ToString https://github.com/Burgyn/MMLib.ToString +165)ToString https://github.com/Burgyn/MMLib.ToString Why I have not put example: old ISourceGenerator -167)Transplator https://github.com/atifaziz/Transplator +166)Transplator https://github.com/atifaziz/Transplator Why I have not put example: old ISourceGenerator -168)TupleOverloadGenerator https://github.com/ProphetLamb/TupleOverloadGenerator +167)TupleOverloadGenerator https://github.com/ProphetLamb/TupleOverloadGenerator Why I have not put example: too complicated -169)TxtToListGenerator https://github.com/musictopia2/TxtToListGenerator +168)TxtToListGenerator https://github.com/musictopia2/TxtToListGenerator Why I have not put example: no readme -170)TypealizR https://github.com/earloc/TypealizR +169)TypealizR https://github.com/earloc/TypealizR Why I have not put example: depends on Microsoft.Extensions.Localization -171)UnitTestBlazor https://github.com/bUnit-dev/bUnit +170)UnitTestBlazor https://github.com/bUnit-dev/bUnit Why I have not put example: issue opened -172)ValueChangedGenerator https://github.com/ufcpp/ValueChangedGenerator +171)ValueChangedGenerator https://github.com/ufcpp/ValueChangedGenerator Why I have not put example: old ISourceGenerator -173)ValueLink https://github.com/archi-Doc/ValueLink +172)ValueLink https://github.com/archi-Doc/ValueLink Why I have not put example: too complicated -174)ValueObjectGenerator https://github.com/RyotaMurohoshi/ValueObjectGenerator +173)ValueObjectGenerator https://github.com/RyotaMurohoshi/ValueObjectGenerator Why I have not put example: old ISourceGenerator -175)VisitorPatternGenerator https://github.com/hikarin522/VisitorPatternGenerator/ +174)VisitorPatternGenerator https://github.com/hikarin522/VisitorPatternGenerator/ Why I have not put example: issue opened -176)Visor https://github.com/Tinkoff/Visor +175)Visor https://github.com/Tinkoff/Visor Why I have not put example: archived -177)WrapperValueObject https://github.com/martinothamar/WrapperValueObject +176)WrapperValueObject https://github.com/martinothamar/WrapperValueObject Why I have not put example: not maintained as in readme -178)Xtz.StronglyTyped https://github.com/dev-experience/Xtz.StronglyTyped +177)Xtz.StronglyTyped https://github.com/dev-experience/Xtz.StronglyTyped Why I have not put example: old ISourceGenerator diff --git a/v2/rscg_examples_site/docs/RSCG-Examples/RapidEnum.md b/v2/rscg_examples_site/docs/RSCG-Examples/RapidEnum.md new file mode 100644 index 000000000..5b7d69ba3 --- /dev/null +++ b/v2/rscg_examples_site/docs/RSCG-Examples/RapidEnum.md @@ -0,0 +1,639 @@ +--- +sidebar_position: 2340 +title: 234 - RapidEnum +description: Generate enum values without reflection +slug: /RapidEnum +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import TOCInline from '@theme/TOCInline'; +import SameCategory from '../Categories/_PrimitiveEnum.mdx'; + +# RapidEnum by hanachiru + + + + +## NuGet / site data +[![Nuget](https://img.shields.io/nuget/dt/RapidEnum?label=RapidEnum)](https://www.nuget.org/packages/RapidEnum/) +[![GitHub last commit](https://img.shields.io/github/last-commit/hanachiru/RapidEnum?label=updated)](https://github.com/hanachiru/RapidEnum) +![GitHub Repo stars](https://img.shields.io/github/stars/hanachiru/RapidEnum?style=social) + +## Details + +### Info +:::info + +Name: **RapidEnum** + +Enum utility with SourceGenerator for C#/.NET + +Author: hanachiru + +NuGet: +*https://www.nuget.org/packages/RapidEnum/* + + +You can find more details at https://github.com/hanachiru/RapidEnum + +Source: https://github.com/hanachiru/RapidEnum + +::: + +### Author +:::note +hanachiru +![Alt text](https://github.com/hanachiru.png) +::: + +### Original Readme +:::note + +# RapidEnum + +[![nuget](https://img.shields.io/nuget/v/RapidEnum)](https://www.nuget.org/packages/RapidEnum) +[![Releases](https://img.shields.io/github/release/hanachiru/RapidEnum.svg)](https://github.com/hanachiru/RapidEnum/releases) +[![license](https://img.shields.io/badge/LICENSE-MIT-green.svg)](https://github.com/hanachiru/RapidEnum/LICENSE) +[![test](https://github.com/hanachiru/RapidEnum/actions/workflows/test.yml/badge.svg)](https://github.com/hanachiru/RapidEnum/actions/workflows/test.yml) + +[日本語版](https://github.com/hanachiru/RapidEnum/README.jp.md) + +RapidEnum is a Source Generator that provides fast-running enum utilities for C#/.NET. It is faster than the [.NET API](https://learn.microsoft.com/en-us/dotnet/api/system.enum?view=net-8.0) and achieves zero allocation for all methods. + +**Package - [RapidEnum](https://www.nuget.org/packages/RapidEnum)** + +![PerformanceComparison](https://github.com/hanachiru/RapidEnum/Images/PerformanceComparison.png) + +It performed better than .NET API. It is also faster than [FastEnum v1.8.0](https://github.com/xin9le/FastEnum/releases/tag/v1.8.0). For more information on performance comparisons, see [this](https://github.com/hanachiru/RapidEnum). + +RapidEnum is heavily influenced by [FastEnum](https://github.com/xin9le/FastEnum). API is very similar to FastEnum. Thanks to [xin9le](https://github.com/xin9le) for creating a great library! + +# Table of Contents + +- [Requirements](#Requirements) +- [Installation](#Installation) + - [NuGet](#NuGet) + - [Unity](#Unity) + - [asmdef settings](#asmdef-settings) +- [How to use](#How-to-use) + - [Basic usage](#Basic-usage) + - [How to use it for any enum](#How-to-use-it-for-any-enum) + - [Get Name and Value as a pair](#Get-Name-and-Value-as-a-pair) + - [Use EnumMemberAttribute](#Use-EnumMemberAttribute) +- [Performance comparison](#Performance-comparison) + +# Requirements + +- .NET Standard2.0 or newer +- Unity 2022.3.12f1 or newer + +# Installation + +## NuGet + +```shell +$ dotnet add package RapidEnum +``` + +**nuget.org : [RapidEnum](https://www.nuget.org/packages/RapidEnum)** + +## Unity + +Add the following git URL from the Package Manager + +``` +https://github.com/hanachiru/RapidEnum.git?path=/RapidEnum.Unity/Packages/com.hanachiru.rapidenum +``` + +![UPM](https://github.com/hanachiru/RapidEnum/Images/UPM.png) + +### asmdef settings +If you have created a `.asmdef`, you need to add `RapidEnum` to the Assembly Definition References. + + + +# How to use + +## Basic usage + +Attaching `[RapidEnum]` to the target enum generates an enum utility class. Note that this is only valid for `public` or `internal` enum. + +```csharp +[RapidEnum] +public enum Weather +{ + Sun, + Cloud, + Rain, + Snow +} +``` + +The `Enum name + EnumExtensions` class defines the relevant methods. + +```csharp +// Sun,Cloud,Rain,Snow +IReadOnlyList values = WeatherEnumExtensions.GetValues(); + +// Sun,Cloud,Rain,Snow +IReadOnlyList names = WeatherEnumExtensions.GetNames(); + +// Rain +string name = WeatherEnumExtensions.GetName(Weather.Rain); + +// Cloud +string str = Weather.Cloud.ToStringFast(); + +// True +bool defined = WeatherEnumExtensions.IsDefined("Sun"); + +// Sun +Weather parse = WeatherEnumExtensions.Parse("Sun"); + +// True +// Sun +bool tryParse = WeatherEnumExtensions.TryParse("Sun", out Weather value); +``` + +## How to use it for any enum + +The `[RapidEnumWithType]` can be used to generate utility classes for any enum. + +For `static partial class` that are `public` or `internal`, give them a `[RapidEnumWithType]` with the target enum as an argument. The class name can be any string, but `Enum name + EnumExtensions` is easier to understand. + +```csharp +// System.DateTimeKind has Unspecified, Utc, Local +[RapidEnumWithType(typeof(DateTimeKind))] +public static partial class DateTimeKindEnumExtensions +{ +} +``` + +There is no performance difference compared to using `[RapidEnum]`. Use `[RapidEnumWithType]` if `[RapidEnum]` cannot be given, such as an enum provided by a third-party library. + +```csharp +// Unspecified,Utc,Local +IReadOnlyList values = DateTimeKindEnumExtensions.GetValues(); + +// Unspecified,Utc,Local +IReadOnlyList names = DateTimeKindEnumExtensions.GetNames(); + +// Local +string name = DateTimeKindEnumExtensions.GetName(DateTimeKind.Local); + +// Local +string str = DateTimeKind.Local.ToStringFast(); + +// True +bool defined = DateTimeKindEnumExtensions.IsDefined("Local"); + +// Local +DateTimeKind parse = DateTimeKindEnumExtensions.Parse("Local"); + +// True +// Local +bool tryParse = DateTimeKindEnumExtensions.TryParse("Local", out DateTimeKind value); +``` + +## Get Name and Value as a pair + +Use the `GetMembers` and `GetMember` methods if you want to get the Name and Value of enum in pairs. + +```csharp +WeatherEnumExtensions.Member member = WeatherEnumExtensions.GetMember(Weather.Rain); +var (name, value) = member; + +foreach (WeatherEnumExtensions.Member item in WeatherEnumExtensions.GetMembers()) +{ + Console.WriteLine($"Name : {item.Name}, Value : {item.Value}"); +} +``` + +## Use EnumMemberAttribute +If you use [EnumMemberAttribute](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.enummemberattribute?view=net-9.0), you can get the Value property of EnumMemberAttribute. +```csharp +[RapidEnum] +public enum Weather +{ + [EnumMember(Value = "sun")] + Sun, + [EnumMember] + Cloud, + [EnumMember(Value = "rain")] + Rain, + Snow +} +``` +```csharp +// sun +string enumMemberValue = Weather.Sun.GetEnumMemberValue(); + +// null +string enumMemberValue = Weather.Cloud.GetEnumMemberValue(); +``` + +# Performance comparison + +| Method | Mean | Error | StdDev | Median | Gen0 | Allocated | +| ------------------- | ---------: | --------: | --------: | ---------: | -----: | --------: | +| RapidEnum_GetValues | 0.0042 ns | 0.0059 ns | 0.0052 ns | 0.0028 ns | - | - | +| FastEnum_GetValues | 0.0083 ns | 0.0086 ns | 0.0081 ns | 0.0055 ns | - | - | +| NET_GetValues | 64.4620 ns | 0.9908 ns | 0.9268 ns | 64.2767 ns | 0.0048 | 40 B | +| RapidEnum_GetNames | 0.0006 ns | 0.0017 ns | 0.0015 ns | 0.0000 ns | - | - | +| FastEnum_GetNames | 0.0025 ns | 0.0031 ns | 0.0028 ns | 0.0012 ns | - | - | +| NET_GetNames | 12.3820 ns | 0.1086 ns | 0.1016 ns | 12.4076 ns | 0.0067 | 56 B | +| RapidEnum_GetName | 0.0069 ns | 0.0085 ns | 0.0071 ns | 0.0039 ns | - | - | +| FastEnum_GetName | 0.2530 ns | 0.0070 ns | 0.0065 ns | 0.2527 ns | - | - | +| NET_GetName | 15.9190 ns | 0.0524 ns | 0.0490 ns | 15.9046 ns | 0.0029 | 24 B | +| RapidEnum_ToString | 0.0103 ns | 0.0049 ns | 0.0046 ns | 0.0110 ns | - | - | +| FastEnum_ToString | 0.4844 ns | 0.0062 ns | 0.0052 ns | 0.4845 ns | - | - | +| NET_ToString | 6.1700 ns | 0.0451 ns | 0.0376 ns | 6.1493 ns | 0.0029 | 24 B | +| RapidEnum_IsDefines | 0.0026 ns | 0.0036 ns | 0.0034 ns | 0.0000 ns | - | - | +| FastEnum_IsDefines | 4.6724 ns | 0.0583 ns | 0.0545 ns | 4.6434 ns | - | - | +| NET_IsDefines | 14.5923 ns | 0.0355 ns | 0.0332 ns | 14.5996 ns | - | - | +| RapidEnum_Parse | 0.9258 ns | 0.0161 ns | 0.0150 ns | 0.9240 ns | - | - | +| FastEnum_Parse | 4.6223 ns | 0.0082 ns | 0.0073 ns | 4.6192 ns | - | - | +| NET_Parse | 8.8707 ns | 0.0965 ns | 0.0903 ns | 8.8293 ns | - | - | +| RapidEnum_TryParse | 0.7633 ns | 0.0097 ns | 0.0090 ns | 0.7657 ns | - | - | +| FastEnum_TryParse | 4.6869 ns | 0.0254 ns | 0.0212 ns | 4.6852 ns | - | - | +| NET_TryParse | 8.8433 ns | 0.0609 ns | 0.0569 ns | 8.8268 ns | - | - | + +![PerformanceComparison](https://github.com/hanachiru/RapidEnum/Images/PerformanceComparison.png) + +[Benchmark Source](https://github.com/hanachiru/RapidEnum/tree/main/RapidEnum.Benchmark) + +``` +BenchmarkDotNet v0.14.0, macOS Sonoma 14.4.1 (23E224) [Darwin 23.4.0] +Apple M2 Pro, 1 CPU, 12 logical and 12 physical cores +.NET SDK 8.0.303 +[Host] : .NET 8.0.7 (8.0.724.31311), Arm64 RyuJIT AdvSIMD +DefaultJob : .NET 8.0.7 (8.0.724.31311), Arm64 RyuJIT AdvSIMD +``` + + +::: + +### About +:::note + +Generate enum values without reflection + + +::: + +## How to use + +### Example (source csproj, source files) + + + + + +This is the CSharp Project that references **RapidEnum** +```xml showLineNumbers {16} + + + + Exe + net9.0 + enable + enable + + + + true + $(BaseIntermediateOutputPath)\GX + + + + + + + + +``` + + + + + + This is the use of **RapidEnum** in *Program.cs* + +```csharp showLineNumbers +// See https://aka.ms/new-console-template for more information +using EnumDemo; + +Console.WriteLine("Hello, World!"); +Console.WriteLine("Car types:" + CarTypesEnumExtensions.GetValues().Count); +var cars = CarTypesEnumExtensions.GetValues(); +foreach (var car in cars) +{ + Console.WriteLine(car.ToStringFast()); +} +``` + + + + + This is the use of **RapidEnum** in *CarTypes.cs* + +```csharp showLineNumbers + +namespace EnumDemo; +[RapidEnum.RapidEnum] +public enum CarTypes +{ + None, + Dacia , + Tesla , + BMW , + Mercedes , +} + +``` + + + + +### Generated Files + +Those are taken from $(BaseIntermediateOutputPath)\GX + + + + +```csharp showLineNumbers +// + +namespace EnumDemo +{ + + public static partial class CarTypesEnumExtensions + { + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static string ToStringFast(this global::EnumDemo.CarTypes value) + { + return value switch + { + global::EnumDemo.CarTypes.None => nameof(global::EnumDemo.CarTypes.None), + global::EnumDemo.CarTypes.Dacia => nameof(global::EnumDemo.CarTypes.Dacia), + global::EnumDemo.CarTypes.Tesla => nameof(global::EnumDemo.CarTypes.Tesla), + global::EnumDemo.CarTypes.BMW => nameof(global::EnumDemo.CarTypes.BMW), + global::EnumDemo.CarTypes.Mercedes => nameof(global::EnumDemo.CarTypes.Mercedes), + _ => value.ToString() + }; + } + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static bool IsDefined(global::EnumDemo.CarTypes value) + { + return value switch + { + global::EnumDemo.CarTypes.None => true, + global::EnumDemo.CarTypes.Dacia => true, + global::EnumDemo.CarTypes.Tesla => true, + global::EnumDemo.CarTypes.BMW => true, + global::EnumDemo.CarTypes.Mercedes => true, + _ => false, + }; + } + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static bool IsDefined(string name) + { + return name switch + { + nameof(global::EnumDemo.CarTypes.None) => true, + nameof(global::EnumDemo.CarTypes.Dacia) => true, + nameof(global::EnumDemo.CarTypes.Tesla) => true, + nameof(global::EnumDemo.CarTypes.BMW) => true, + nameof(global::EnumDemo.CarTypes.Mercedes) => true, + _ => false, + }; + } + + private static readonly global::System.Collections.ObjectModel.ReadOnlyCollection CacheValues = new global::System.Collections.ObjectModel.ReadOnlyCollection(new[] + { + global::EnumDemo.CarTypes.None, + global::EnumDemo.CarTypes.Dacia, + global::EnumDemo.CarTypes.Tesla, + global::EnumDemo.CarTypes.BMW, + global::EnumDemo.CarTypes.Mercedes, + }); + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static global::System.Collections.Generic.IReadOnlyList GetValues() => CacheValues; + + private static readonly global::System.Collections.ObjectModel.ReadOnlyCollection CacheNames = new global::System.Collections.ObjectModel.ReadOnlyCollection(new[] + { + nameof(global::EnumDemo.CarTypes.None), + nameof(global::EnumDemo.CarTypes.Dacia), + nameof(global::EnumDemo.CarTypes.Tesla), + nameof(global::EnumDemo.CarTypes.BMW), + nameof(global::EnumDemo.CarTypes.Mercedes), + }); + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static global::System.Collections.Generic.IReadOnlyList GetNames() => CacheNames; + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static string GetName(global::EnumDemo.CarTypes value) + { + return value.ToStringFast(); + } + + private static readonly global::System.Collections.ObjectModel.ReadOnlyCollection CacheMembers = new global::System.Collections.ObjectModel.ReadOnlyCollection(new[] + { + new Member(nameof(global::EnumDemo.CarTypes.None), global::EnumDemo.CarTypes.None), + new Member(nameof(global::EnumDemo.CarTypes.Dacia), global::EnumDemo.CarTypes.Dacia), + new Member(nameof(global::EnumDemo.CarTypes.Tesla), global::EnumDemo.CarTypes.Tesla), + new Member(nameof(global::EnumDemo.CarTypes.BMW), global::EnumDemo.CarTypes.BMW), + new Member(nameof(global::EnumDemo.CarTypes.Mercedes), global::EnumDemo.CarTypes.Mercedes), + }); + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static global::System.Collections.Generic.IReadOnlyList GetMembers() => CacheMembers; + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static Member GetMember(global::EnumDemo.CarTypes value) + { + return value.ToMember(); + } + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static Member ToMember(this global::EnumDemo.CarTypes value) + { + return new Member(ToStringFast(value), value); + } + + public sealed class Member + { + public string Name \{ get; } + public global::EnumDemo.CarTypes Value \{ get; } + + internal Member(string name, global::EnumDemo.CarTypes value) + { + Name = name; + Value = value; + } + + public void Deconstruct(out string name, out global::EnumDemo.CarTypes value) + { + name = Name; + value = Value; + } + } + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static global::EnumDemo.CarTypes Parse(string name, bool ignoreCase = false) + { + if (TryParse(name, out var value, ignoreCase)) + { + return value; + } + throw new global::System.ArgumentException($"The value '{name}' is not defined in enum 'global::EnumDemo.CarTypes'."); + } + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static bool TryParse( + string name, + out global::EnumDemo.CarTypes value, + bool ignoreCase = false) + { + return ignoreCase ? TryParseIgnoreCase(name, out value) : TryParse(name, out value); + } + + private static bool TryParseIgnoreCase( + string name, + out global::EnumDemo.CarTypes value) + { + switch (name) + { + case not null when name.Equals(nameof(global::EnumDemo.CarTypes.None), global::System.StringComparison.OrdinalIgnoreCase): + value = global::EnumDemo.CarTypes.None; + return true; + case not null when name.Equals(nameof(global::EnumDemo.CarTypes.Dacia), global::System.StringComparison.OrdinalIgnoreCase): + value = global::EnumDemo.CarTypes.Dacia; + return true; + case not null when name.Equals(nameof(global::EnumDemo.CarTypes.Tesla), global::System.StringComparison.OrdinalIgnoreCase): + value = global::EnumDemo.CarTypes.Tesla; + return true; + case not null when name.Equals(nameof(global::EnumDemo.CarTypes.BMW), global::System.StringComparison.OrdinalIgnoreCase): + value = global::EnumDemo.CarTypes.BMW; + return true; + case not null when name.Equals(nameof(global::EnumDemo.CarTypes.Mercedes), global::System.StringComparison.OrdinalIgnoreCase): + value = global::EnumDemo.CarTypes.Mercedes; + return true; + case not null when int.TryParse(name, out var val): + value = (global::EnumDemo.CarTypes)val; + return true; + default: + value = default; + return false; + } + } + + private static bool TryParse( + string name, + out global::EnumDemo.CarTypes value) + { + switch (name) + { + case nameof(global::EnumDemo.CarTypes.None): + value = global::EnumDemo.CarTypes.None; + return true; + case nameof(global::EnumDemo.CarTypes.Dacia): + value = global::EnumDemo.CarTypes.Dacia; + return true; + case nameof(global::EnumDemo.CarTypes.Tesla): + value = global::EnumDemo.CarTypes.Tesla; + return true; + case nameof(global::EnumDemo.CarTypes.BMW): + value = global::EnumDemo.CarTypes.BMW; + return true; + case nameof(global::EnumDemo.CarTypes.Mercedes): + value = global::EnumDemo.CarTypes.Mercedes; + return true; + case not null when int.TryParse(name, out var val): + value = (global::EnumDemo.CarTypes)val; + return true; + default: + value = default; + return false; + } + } + + private static readonly global::System.Type CacheUnderlyingType = global::System.Enum.GetUnderlyingType(typeof(global::EnumDemo.CarTypes)); + public static global::System.Type GetUnderlyingType() => CacheUnderlyingType; + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static string GetEnumMemberValue(this global::EnumDemo.CarTypes value) + { + return value switch + { + global::EnumDemo.CarTypes.None => null, + global::EnumDemo.CarTypes.Dacia => null, + global::EnumDemo.CarTypes.Tesla => null, + global::EnumDemo.CarTypes.BMW => null, + global::EnumDemo.CarTypes.Mercedes => null, + _ => null + }; + } + } +} +``` + + + + +```csharp showLineNumbers +// + +namespace RapidEnum +{ + [global::System.AttributeUsage(global::System.AttributeTargets.Enum)] + internal sealed class RapidEnumAttribute : global::System.Attribute + { + + } + + [global::System.AttributeUsage(global::System.AttributeTargets.Class, Inherited = false)] + public sealed class RapidEnumWithTypeAttribute : global::System.Attribute + { + public global::System.Type Type \{ get; } + + public RapidEnumWithTypeAttribute(global::System.Type type) + { + Type = type; + } + } +} +``` + + + + +## Useful + +### Download Example (.NET C#) + +:::tip + +[Download Example project RapidEnum ](/sources/RapidEnum.zip) + +::: + + +### Share RapidEnum + + + +https://ignatandrei.github.io/RSCG_Examples/v2/docs/RapidEnum + + + diff --git a/v2/rscg_examples_site/docs/RSCG-Examples/index.md b/v2/rscg_examples_site/docs/RSCG-Examples/index.md index 584c88423..af504d1a3 100644 --- a/v2/rscg_examples_site/docs/RSCG-Examples/index.md +++ b/v2/rscg_examples_site/docs/RSCG-Examples/index.md @@ -1,7 +1,7 @@ --- sidebar_position: 30 -title: 233 RSCG list by category -description: 233 RSCG list by category +title: 234 RSCG list by category +description: 234 RSCG list by category slug: /rscg-examples --- @@ -704,7 +704,7 @@ import DocCardList from '@theme/DocCardList'; ## Enum
- Expand Enum =>examples:11 + Expand Enum =>examples:12 @@ -760,6 +760,11 @@ import DocCardList from '@theme/DocCardList'; [requiredenum](/docs/requiredenum) + + + +[RapidEnum](/docs/RapidEnum) +
@@ -1701,6 +1706,8 @@ flowchart LR; Enum--> requiredenum((requiredenum)) + Enum--> RapidEnum((RapidEnum)) + Equals--> GeneratorEquals((GeneratorEquals)) Equals--> Equatable.Generator((Equatable.Generator)) diff --git a/v2/rscg_examples_site/docs/about.md b/v2/rscg_examples_site/docs/about.md index 9539d2e55..382c89954 100644 --- a/v2/rscg_examples_site/docs/about.md +++ b/v2/rscg_examples_site/docs/about.md @@ -6,7 +6,7 @@ title: About ## Content You will find here code examples -of 233 Roslyn Source Code Generator (RSCG) +of 234 Roslyn Source Code Generator (RSCG) that can be useful for you. That means, you will write more elegant and concise code - even if the generators code is not always nice to look. ## Are those examples ready for production? diff --git a/v2/rscg_examples_site/docs/indexRSCG.md b/v2/rscg_examples_site/docs/indexRSCG.md index 11a8743ca..4b806fac1 100644 --- a/v2/rscg_examples_site/docs/indexRSCG.md +++ b/v2/rscg_examples_site/docs/indexRSCG.md @@ -7,9 +7,9 @@ slug: /List-of-RSCG import useBaseUrl from '@docusaurus/useBaseUrl'; -## 233 RSCG with examples in descending chronological order +## 234 RSCG with examples in descending chronological order -This is the list of 233 ( 14 from Microsoft) RSCG with examples +This is the list of 234 ( 14 from Microsoft) RSCG with examples [See by category](/docs/rscg-examples) [See as json](/exports/RSCG.json) [See as Excel](/exports/RSCG.xlsx) @@ -20,6 +20,7 @@ This is the list of 233 ( 14 from Microsoft) RSCG with examples | No | Name | Date | Category | | --------- | ----- | ---- | -------- | +|234| [RapidEnum by hanachiru ](/docs/RapidEnum)|2025-10-04 => 04 October 2025 | [Enum](/docs/Categories/Enum) | |233| [VYaml by Hadashi A ](/docs/VYaml)|2025-10-03 => 03 October 2025 | [Serializer](/docs/Categories/Serializer) | |232| [ConsoleAppFramework by Cysharp, Inc. ](/docs/ConsoleAppFramework)|2025-10-02 => 02 October 2025 | [Console](/docs/Categories/Console) | |231| [kli.Localize by Tobias Klimm ](/docs/kli.Localize)|2025-10-01 => 01 October 2025 | [FilesToCode](/docs/Categories/FilesToCode) | diff --git a/v2/rscg_examples_site/src/components/HomepageFeatures/index.js b/v2/rscg_examples_site/src/components/HomepageFeatures/index.js index c6cf9c7fc..3ad6c7bc0 100644 --- a/v2/rscg_examples_site/src/components/HomepageFeatures/index.js +++ b/v2/rscg_examples_site/src/components/HomepageFeatures/index.js @@ -4,7 +4,7 @@ import styles from './styles.module.css'; const FeatureList = [ { -title: '233 Examples (14 from MSFT)', +title: '234 Examples (14 from MSFT)', Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, description: ( <> diff --git a/v2/rscg_examples_site/static/exports/RSCG.json b/v2/rscg_examples_site/static/exports/RSCG.json index c29836914..39dec22ab 100644 --- a/v2/rscg_examples_site/static/exports/RSCG.json +++ b/v2/rscg_examples_site/static/exports/RSCG.json @@ -1865,6 +1865,14 @@ "Source": "https://github.com/hadashiA/VYaml", "Category": "Serializer", "AddedOn": "2025-10-03T00:00:00" + }, + { + "Name": "RapidEnum", + "Link": "https://ignatandrei.github.io/RSCG_Examples/v2/docs/RapidEnum", + "NuGet": "https://www.nuget.org/packages/RapidEnum/", + "Source": "https://github.com/hanachiru/RapidEnum", + "Category": "Enum", + "AddedOn": "2025-10-04T00:00:00" } ] } \ No newline at end of file diff --git a/v2/rscg_examples_site/static/exports/RSCG.xlsx b/v2/rscg_examples_site/static/exports/RSCG.xlsx index f44832c5b59cd3b6b00aca557c2023427e7a717e..886b2f1b483228f9889a7edc53158012804f1eaa 100644 GIT binary patch delta 889 zcmZ3ObTX+vz?+#xgn@yBgW;l`OSI{^hfN0=7#Nfo85sD1bVZJSd45rLQht86UPW$B zZ~wu(W&@tKc-2p}yd_(tIbI}AUKaaOIOU*bpl8pc4Ih7;&A1*{{`=4EP5buS>Ewyr zm$)%0U*Ud=!iDTtYwb-9+&_QeYTp*ON}lVv{-Vtu-{;k@UfQU5Y~`d$UmN^BwyAx| zOxLgwy)5B3X?eq{=ZuEC0`oTK=+E6GSNDId=6%nKryCmI{rJY1H#|q{)uC3q;s%}v7N`F1-2A3{ z{Ytr<1zd|&FLU3>+BJ(c=i&F9GnMQ1=KWpAv#YXEn>m;1o~9kkqp~{di#~PN_3Fdw z_fN6^zy3cn%xVU3NMAk5F=I2Ijx?iyfq{Xsk*S$cim8c_iBW3uWJ_H+4v>?wZLVuf zj@Q+wKj?QD66kZSaxXhw+!VW`VD2}j$Y)!w-cs>0x-qYpx&Mf^fLcpfC$qTUwEElg z?M}+)zh8Z}a^4N@Rtqcbg*p}nn{LUv-S)OnE&k3h`)ii>WUoqPzQz4I^KWP*dYrUZ za0o%~jB-an_3V?DFx&9OV1a#=s2 z=cQ2~%eLT!%T*Z9UoH**xg|IFW7x`B;b-@W`sy}3+|RjpS3wVRV3gJ0BauH> zPcg4rx?sIpN80@&bL6Xb|sIe8Z=CzyxW@ z!oa`_Oq2-l4#)&1(c+TIoYZ1a0uAtHWD;ROq-R8|GBHRX^Z{AhnI>OklA7#kz!L$o z0~8$^Ks!K~8%3dt4g*7cQEE=Hz8;7~w*eGMw}Be=0yRpZXe^z))*UWMJS2(iJ)S<@rU~N%{HNdKI}j zz5S>A4jJ&c)~kM!o5a+#FzYmv$`P@B3QO{&FCGb%Suo$f;%rWOc};HQbFtYMzdmYf z)cq;6X(dzRy@1@>=tHJvljU!O9G!7rGv=I&_{4X%&y(vpV|$$SRA=+eeWuC#;_|wM z4@!KJGgSE*OV7$CmF%6Pxpj(PH2?Yf^;7CSE8cEsd7QbM{i7FO=_N+NqS+5th-Ixi zYZ<-PcF`&Js4mn8^n(t0vKZ zX%pi?Mm~_w5Fr2daJQK5~U6$D1*87_cpYJS7{<7OBqo3tIZ$SB9zmJL= zwtl|dx$OP!vY(rOHR{&?i~r9KGnN4yh7DH_1#C9ck!BPyPffN=G%!guv9w4vF)}ru zoTw|u0kZ7cViDQN?YbKEwt0sQc-+=26|Dc7Y@XY!5xJ>^w}>%vQI7I96%VgjbJjZd zU(pWXZBk;hDtYPhLHXwghPr+AYs{W!s;Kv5e(+;jFCkEJYxcoXp}w1THiy&p-g>yA z=%&YC0U=FwJww4db< z_r+-Ij5}4eb1poMKVb6obO+~&xTAcVS*qmnBSRw`;(A+Rv!%3qD%P;(&vw;rxKJ-# z_4(t3sv|b#zdE}=l|L-6T9df-l5Ty~!!?FmcfGoJQ}|juEKDHj>ZacOhrfX7DT0ZC zK^RC!JLl(>q~>j2t0%q|4fnJjG}Baa$2Obil0%?Pk{a+ra- z0!R%g&^3UG7KFJG3V^IX+LPxRNFsuLpMe;YukPfDx-$F$-i%Bl4Di%HnbA<1F=4W- Lp&DDaKFACJN1{A# From 21aff60e79a88b411088ed3d100619ac5cc6ea35 Mon Sep 17 00:00:00 2001 From: Andrei Ignat Date: Sat, 4 Oct 2025 07:57:43 +0300 Subject: [PATCH 2/2] sec --- v2/book/examples/RapidEnum.html | 64 ++++++++++++++++++ v2/book/list.html | 6 +- v2/book/pandocHTML.yaml | 1 + .../static/sources/RapidEnum.zip | Bin 0 -> 1517 bytes 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 v2/book/examples/RapidEnum.html create mode 100644 v2/rscg_examples_site/static/sources/RapidEnum.zip diff --git a/v2/book/examples/RapidEnum.html b/v2/book/examples/RapidEnum.html new file mode 100644 index 000000000..ecae760f0 --- /dev/null +++ b/v2/book/examples/RapidEnum.html @@ -0,0 +1,64 @@ + +

RSCG nr 234 : RapidEnum

+ +

Info

+Nuget : https://www.nuget.org/packages/RapidEnum/ + +

You can find more details at : https://github.com/hanachiru/RapidEnum

+ +

Author :hanachiru

+ +

Source: https://github.com/hanachiru/RapidEnum

+ +

About

+ +Generate enum values without reflection + +

+ How to use +

+

+ Add reference to the RapidEnum in the csproj +

+ + +

This was for me the starting code

+ +
+ I have coded the file Program.cs +
+ +
+ +
+ I have coded the file CarTypes.cs +
+ +
+

And here are the generated files

+ +
+ The file generated is CarTypesEnumExtensions.g.cs +
+ + +
+ The file generated is RapidEnumAttributes.g.cs +
+ + +

+ You can download the code and this page as pdf from + + https://ignatandrei.github.io/RSCG_Examples/v2/docs/RapidEnum + +

+ + +

+ You can see the whole list at + + https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG + +

+ diff --git a/v2/book/list.html b/v2/book/list.html index 61f1a78c5..c91062462 100644 --- a/v2/book/list.html +++ b/v2/book/list.html @@ -17,7 +17,7 @@

-This is the list of 233 RSCG with examples => +This is the list of 234 RSCG with examples =>

@@ -958,6 +958,10 @@

+ + + +
233 VYaml
234RapidEnum
diff --git a/v2/book/pandocHTML.yaml b/v2/book/pandocHTML.yaml index c63844cfa..8e2e58887 100644 --- a/v2/book/pandocHTML.yaml +++ b/v2/book/pandocHTML.yaml @@ -247,6 +247,7 @@ input-files: - examples/kli.Localize.html - examples/ConsoleAppFramework.html - examples/VYaml.html +- examples/RapidEnum.html # or you may use input-file: with a single value # defaults: diff --git a/v2/rscg_examples_site/static/sources/RapidEnum.zip b/v2/rscg_examples_site/static/sources/RapidEnum.zip new file mode 100644 index 0000000000000000000000000000000000000000..daa4e0214de7e2db62ca080ba2a1040fde9ef263 GIT binary patch literal 1517 zcmWIWW@Zs#U|`^2=$t4UeV_Ay{7yy&h5{A_1|FcOYhG!tOKNVuUU5#|(#ae1ZW{=+ zJ?FS!&GBjylcJ;77FAwZmzh58%M7x%1dHEX#49!>!z1P5fv=NGUnoBn^*TCH*g8+Z z;`ZIY#~&a6zht+4eeHWUy{Nk{mvZhqd2X8449RFu*)v-A9RFy{}x@>DrAdr7YPv+hh0J8T58- zmA;idJ7>}|m8B9NOnMn4Kl3cnkZWcVS6TRzuX~;Mep)TQJKo2b~0pY+RHU>s@9Zhx2cu?N>X}O_SHH+uQ}=0)syU%_dmF51eQJW zJRNw{)N%uJPkIFZ4gG+Z=WLEv%~k)!w|8Q3~Q#VTa=*ss`7O(mCGd-5``oYis#@}Xf-_Tc{<#%rBq-SO7b7Ou9 z#79S3Ryr%WX!=U*`2Wzu&)`JRJO(qbM>RH17T%BFdN$M^{r-vav2#`BPLYNK`u6&v?1xG`ea`uW zG!!`nbr(O7QNLdxaoK#UhNUTM2GfN2)2CS(5RU5wI<9!Kv49jX{pm6>Fi0Rf4(3Xr z;|hxMvsx#e^=ozzX}zxc(pun=lX<}1nFn-Crfk??wpB_z&uzz1!Ds5ztuNZm=9WJh zUf>Xge$^E%7#>CYa&wT)X;*VgoB_9nk3?Z5?jU)v73?&6y(x?!dH*P8u@c@%Pu zuUy-3uISlT)#S{*rUx#CcPzHG70B)ry&$u*MZDKE*x~s@oxWrL8lGP=StL+$n=5oH zk4Sw^%)1kE4_b3)t=o6F%+0>gMDFJUxyhb$yd0-TNnK<}TfkuHXj#50wdLB=e~e!k z+q2`3M-){hxgQtb(;6eVpe4xS$?l3z6Yd_rxLG zye|X8(FGW$!pPwnP?Voul$Z+)&ffn0e$0kE$G&@1vKL>Tn=yH>=;e!t4qWRxcQG-; zMQDDKe0@uW5u03R_yP7Dg9j()zqy}YFQ5PZ-eEq$J|*S#d-%T}O#Q|xKb={0S&R2U zn`H_d+d~wCT{~QF%culxOnVgZE+KeXP2bFG*CH<0PktA$_(7=74YTPpgmfP`nBJXZ za`)HyrFJ0`o(oo9J)pVb*7>Au_iQ-Du2sL$3s~noYr^ewUrj`3o|T&-0v2=ha+> literal 0 HcmV?d00001