Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Windows Forms application configuration and bootstrap #5035

Merged
merged 4 commits into from
Jul 29, 2021

Commits on Jul 28, 2021

  1. Add ApplicationConfiguration.Initialize() source generator

    Add a C# source generator that emits application bootstrap as described
    in https://github.com/dotnet/designs/blob/main/accepted/2021/winforms/streamline-application-bootstrap.md
    for the following properties:
    * ApplicationVisualStyles
    * ApplicationDefaultFont
    * ApplicationHighDpiMode
    * ApplicationUseCompatibleTextRendering
    
    For top level statements the bootstrap also emits code to set STA mode.
    
    A build will fail if any of the properties contain invalid or otherwise
    incorrect values.
    
    FontConverter is not available in netstandard 2.0, to bridge the gap
    FontConverter logic has been partially copied from the corresponding .NET
    runtime implementation to facilitate the comparable behaviour.
    The only missing gap is parsing of FontFamily (which requires GDI+ calls),
    which means that if a supplied font descriptor contains an invalid font
    name it will cause an app to crash. This however is a desired behaviour.
    RussKie committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    31dcabd View commit details
    Browse the repository at this point in the history
  2. Add general purpose analyzers

    Add analyzers for C# and VB projects that check whether a user project
    contains a manifest file, which includes dpi configurations.
    If such manifest is detected the user is advised to use Application.SetHighDpiMode()
    API instead.
    RussKie committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    4719079 View commit details
    Browse the repository at this point in the history
  3. Package analyzers

    RussKie committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    8848001 View commit details
    Browse the repository at this point in the history
  4. Local testing

    RussKie committed Jul 28, 2021
    Configuration menu
    Copy the full SHA
    329e453 View commit details
    Browse the repository at this point in the history