Xunet.WinFormium 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Xunet.WinFormium --version 1.0.2                
NuGet\Install-Package Xunet.WinFormium -Version 1.0.2                
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="Xunet.WinFormium" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Xunet.WinFormium --version 1.0.2                
#r "nuget: Xunet.WinFormium, 1.0.2"                
#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.
// Install Xunet.WinFormium as a Cake Addin
#addin nuget:?package=Xunet.WinFormium&version=1.0.2

// Install Xunet.WinFormium as a Cake Tool
#tool nuget:?package=Xunet.WinFormium&version=1.0.2                

Xunet.WinFormium

A Lightweight WinForm Application Framework For .NET

Support .NET 8.0

Nuget Downloads License Vistors

安装

Xunet.WinFormium 以 NuGet 包的形式提供。您可以使用 NuGet 包控制台窗口安装它:

PM> Install-Package Xunet.WinFormium

使用

Program.cs

using Xunet.WinFormium.Core;

internal static class Program
{
    /// <summary>
    ///  The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
        // To customize application configuration such as set high DPI settings or default font,
        // see https://aka.ms/applicationconfiguration.
        ApplicationConfiguration.Initialize();

        ServiceConfiguration.Initialize(new StartupOptions
        {
            Headers = new()
            {
                {
                    HeaderNames.UserAgent,
                    "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B329 MicroMessenger/5.0.1"
                }
            },
            Storage = new()
            {
                //StorageName = "Xunet.WinFormium.Tests",
                //EntityTypes = [typeof(TestModel)]
            },
            Generator = new()
            {
                WorkerId = 1
            }
        });

        Application.Run(new MainForm());
    }
}

MainForm.cs

using Xunet.WinFormium

public class MainForm : BaseForm
{
    protected override string BaseText => $"测试 - {Version}";

    protected override Size BaseClientSize => new(600, 400);

    protected override int BaseDoWorkInterval => 60;

    protected override void DoWork(CancellationToken cancellationToken)
    {
        Task.Run(async () =>
        {
            try
            {
                AppendBox(this, "开始工作,请稍后 ...", ColorTranslator.FromHtml("#1296db"));

                // TODO

                AppendBox(this, "工作完成!", ColorTranslator.FromHtml("#1296db"));
            }
            catch (Exception ex)
            {
                AppendBox(this, "系统错误!", Color.Red);
                AppendBox(this, ex.ToString(), Color.Red);
            }
        }, cancellationToken);
    }
}
Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.0.11 111 8/16/2024
1.0.10 99 8/14/2024
1.0.9 99 8/14/2024
1.0.8 100 8/12/2024
1.0.7 111 8/9/2024
1.0.6 89 8/7/2024
1.0.5 88 8/7/2024
1.0.4 90 8/7/2024
1.0.3 88 8/7/2024
1.0.2 71 8/6/2024