RSCG_Wait by Andrei Ignat
Nuget / site data
Details
Info
Name: RSCG_Wait
This package wait for a time and put all global options into a cs file
Author: Andrei Ignat
NuGet: https://www.nuget.org/packages/RSCG_WaitAndOptions/
You can find more details at https://github.com/ignatandrei/RSCG_WaitAndOptions
Original Readme
RSCG_WaitAndOptions
Wait pending compilation and see compiling options
This package is just for demo purposes and it is not intended to be used in production code.
More details at https://ignatandrei.github.io/RSCG_Examples/v2/docs/GoodPractices
How to use
Add the Nuget package RSCG_WaitAndOptions to your project and use the following code:
<ItemGroup>
<CompilerVisibleProperty Include="RSCG_Wait_Seconds" />
</ItemGroup>
<PropertyGroup>
<RSCG_Wait_Seconds>10</RSCG_Wait_Seconds>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="RSCG_WaitAndOptions" Version="2024.2.24.1940"
OutputItemType="Analyzer" ReferenceOutputAssembly="false"
/>
</ItemGroup>
And then compile the code . You will see in obj/GX the code generated
And you can access by
Console.WriteLine(RSCG_Wait.MyGeneratedCode.DateStart);
Console.WriteLine(RSCG_Wait.MyGeneratedCode.SecondsToWait);
Console.WriteLine(RSCG_Wait.MyGeneratedCode.DateEnd);
Console.WriteLine(RSCG_Wait.OptionsFromBuild.build_property_projectdir);
About
Demo for waiting in compilation and show the options of compiling the code
How to use
Example ( source csproj, source files )
- CSharp Project
- Program.cs
This is the CSharp Project that references RSCG_Wait
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<CompilerVisibleProperty Include="RSCG_Wait_Seconds" />
</ItemGroup>
<PropertyGroup>
<RSCG_Wait_Seconds>10</RSCG_Wait_Seconds>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="RSCG_WaitAndOptions" Version="2024.2.24.1940"
OutputItemType="Analyzer" ReferenceOutputAssembly="false"
/>
</ItemGroup>
<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
</Project>
This is the use of RSCG_Wait in Program.cs
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
Console.WriteLine(RSCG_Wait.MyGeneratedCode.DateStart);
Console.WriteLine(RSCG_Wait.MyGeneratedCode.SecondsToWait);
Console.WriteLine(RSCG_Wait.MyGeneratedCode.DateEnd);
Console.WriteLine(RSCG_Wait.OptionsFromBuild.build_property_projectdir);
Console.WriteLine(RSCG_Wait.OptionsFromBuild.build_property_rootnamespace);
Console.WriteLine(RSCG_Wait.OptionsFromBuild.build_property__supportedplatformlist );
Generated Files
Those are taken from $(BaseIntermediateOutputPath)\GX
- GeneratorOptions.g.cs
- WaitGeneratorEnd.g.cs
- WaitGeneratorStart.g.cs
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool RSCG_Wait.
// Runtime Version: 2024.2.24.1940
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//pragma warning disable CS1591
namespace RSCG_Wait;
[global::System.CodeDom.Compiler.GeneratedCode("RSCG_Wait", "2024.2.24.1940")]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class OptionsFromBuild
{//real name: build_property.rootnamespace
public static string build_property_rootnamespace => @"Console_Wait";
//real name: build_property.projecttypeguids
public static string build_property_projecttypeguids => @"";
//real name: build_property.enforceextendedanalyzerrules
public static string build_property_enforceextendedanalyzerrules => @"";
//real name: build_property.rscg_wait_seconds
public static string build_property_rscg_wait_seconds => @"10";
//real name: build_property.targetframework
public static string build_property_targetframework => @"net8.0";
//real name: build_property.targetplatformminversion
public static string build_property_targetplatformminversion => @"";
//real name: build_property.invariantglobalization
public static string build_property_invariantglobalization => @"";
//real name: build_property.platformneutralassembly
public static string build_property_platformneutralassembly => @"";
//real name: build_property.projectdir
public static string build_property_projectdir => @"D:\gth\RSCG_Examples\v2\rscg_examples\RSCG_Wait\src\Console_Wait\";
//real name: build_property.enablecomhosting
public static string build_property_enablecomhosting => @"";
//real name: build_property.enablegeneratedcominterfacecomimportinterop
public static string build_property_enablegeneratedcominterfacecomimportinterop => @"";
//real name: build_property._supportedplatformlist
public static string build_property__supportedplatformlist => @"Linux,macOS,Windows";
//real name: build_property.usingmicrosoftnetsdkweb
public static string build_property_usingmicrosoftnetsdkweb => @"";
}//end class//end namespace
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool RSCG_Wait.
// Runtime Version: 2024.2.24.1940
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//pragma warning disable CS1591
namespace RSCG_Wait;
partial class MyGeneratedCode
{
public static string DateEnd => "9/22/2024 9:58:14 PM";
}
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool RSCG_Wait.
// Runtime Version: 2024.2.24.1940
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace RSCG_Wait;
//pragma warning disable CS1591
[global::System.CodeDom.Compiler.GeneratedCode("RSCG_Wait", "2024.2.24.1940")]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class MyGeneratedCode
{
public static string DateStart => "9/22/2024 9:58:04 PM";
public static int SecondsToWait=10;
}
#nullable restore
Usefull
Download Example (.NET C# )
Share RSCG_Wait
https://ignatandrei.github.io/RSCG_Examples/v2/docs/RSCG_Wait