AutoSettingUI.Generator 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package AutoSettingUI.Generator --version 1.2.0
                    
NuGet\Install-Package AutoSettingUI.Generator -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AutoSettingUI.Generator" Version="1.2.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AutoSettingUI.Generator" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="AutoSettingUI.Generator">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AutoSettingUI.Generator --version 1.2.0
                    
#r "nuget: AutoSettingUI.Generator, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AutoSettingUI.Generator@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AutoSettingUI.Generator&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=AutoSettingUI.Generator&version=1.2.0
                    
Install as a Cake Tool

AutoSettingUI.Generator

Roslyn Incremental Source Generator for AutoSettingUI - Generates AOT-compatible setting descriptors at compile time.

NuGet License: MIT

Installation

<PackageReference Include="AutoSettingUI.Generator" />

What It Does

This source generator automatically generates:

  • GeneratedSettingProvider - Implements ISettingDescriptorProvider
  • GeneratedPropertyAccessor - Implements IPropertyValueAccessor

These generated classes enable full Native AOT and trimming support by eliminating runtime reflection.

How It Works

  1. At compile time, the generator scans for classes decorated with [SettingUI]
  2. It generates strongly-typed descriptor and accessor classes
  3. No runtime reflection is needed to access property metadata or values

Generated Code Example

For a settings class like:

[SettingUI]
public class AppSettings
{
    [Title("Volume")]
    public int Volume { get; set; } = 50;
}

The generator produces (simplified):

public partial class GeneratedSettingProvider : ISettingDescriptorProvider, IPropertyValueAccessor
{
    public SettingClassDescriptor? GetDescriptor(Type type)
    {
        if (type == typeof(AppSettings))
            return GetAppSettingsDescriptor();
        // ... other types
    }

    private SettingClassDescriptor GetAppSettingsDescriptor()
    {
        return new SettingClassDescriptor
        {
            TargetType = typeof(AppSettings),
            Properties = new[]
            {
                new PropertyDescriptor
                {
                    PropertyName = "Volume",
                    PropertyType = typeof(int),
                    // ... metadata from attributes
                }
            }
        };
    }

    public object? GetValue(object target, string propertyName)
    {
        if (target is AppSettings settings)
        {
            return propertyName switch
            {
                "Volume" => settings.Volume,
                // ... other properties
            };
        }
        return null;
    }
}

Usage

// The generated class is in the AutoSettingUI.Generated namespace
panel.DescriptorProvider = new AutoSettingUI.Generated.GeneratedSettingProvider();
panel.PropertyAccessor = new AutoSettingUI.Generated.GeneratedSettingProvider();

Requirements

  • .NET Standard 2.0+ compatible projects
  • C# 9.0+ (for source generators support)
  • AutoSettingUI.Core - Core attributes and interfaces
  • AutoSettingUI.Avalonia - Avalonia UI panel
  • AutoSettingUI.Ursa - Ursa-themed Avalonia panel
  • AutoSettingUI.WPF - WPF panel

Documentation

License

MIT

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.4.1 0 3/31/2026
1.4.0 118 3/28/2026
1.3.1 37 3/25/2026
1.3.0 83 3/21/2026
1.2.0 76 3/20/2026
1.1.0 77 3/20/2026
1.0.1 89 3/17/2026
1.0.0 83 3/17/2026