✉️ 新增 Overview 新增AOT 编译、ChatUI 聊天示例

This commit is contained in:
Tom
2024-05-22 14:50:32 +08:00
parent fb67e87e36
commit 37e5f50e4f
18 changed files with 577 additions and 4 deletions

View File

@@ -13,7 +13,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo", "example\Demo\Demo.c
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Overview", "example\Overview\Overview.csproj", "{2EFC67E4-34D0-4CE3-961C-7FB64AF965D8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SVGView", "example\SVGView\SVGView.csproj", "{48484E20-7B05-41D3-9E76-D59A95A70A80}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SVGView", "example\SVGView\SVGView.csproj", "{48484E20-7B05-41D3-9E76-D59A95A70A80}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChatUI", "example\ChatUI\ChatUI.csproj", "{796C3020-70CB-464D-A67A-66BCC566C6D8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -37,6 +39,10 @@ Global
{48484E20-7B05-41D3-9E76-D59A95A70A80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{48484E20-7B05-41D3-9E76-D59A95A70A80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{48484E20-7B05-41D3-9E76-D59A95A70A80}.Release|Any CPU.Build.0 = Release|Any CPU
{796C3020-70CB-464D-A67A-66BCC566C6D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{796C3020-70CB-464D-A67A-66BCC566C6D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{796C3020-70CB-464D-A67A-66BCC566C6D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{796C3020-70CB-464D-A67A-66BCC566C6D8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -46,6 +52,7 @@ Global
{24C89E6C-0F23-4AFB-9D7F-6419239EE322} = {B9AB491E-DDF2-4E3D-97FA-622E36504B91}
{2EFC67E4-34D0-4CE3-961C-7FB64AF965D8} = {B9AB491E-DDF2-4E3D-97FA-622E36504B91}
{48484E20-7B05-41D3-9E76-D59A95A70A80} = {B9AB491E-DDF2-4E3D-97FA-622E36504B91}
{796C3020-70CB-464D-A67A-66BCC566C6D8} = {B9AB491E-DDF2-4E3D-97FA-622E36504B91}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6B151716-3D07-4DA4-8C4D-2D2BBE164EAA}

View File

@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<ForceDesignerDpiUnaware>true</ForceDesignerDpiUnaware>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\AntdUI\AntdUI.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

109
example/ChatUI/Main.Designer.cs generated Normal file
View File

@@ -0,0 +1,109 @@
namespace ChatUI
{
partial class Main
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
AntdUI.Chat.MsgItem msgItem1 = new AntdUI.Chat.MsgItem();
AntdUI.Chat.MsgItem msgItem2 = new AntdUI.Chat.MsgItem();
AntdUI.Chat.MsgItem msgItem3 = new AntdUI.Chat.MsgItem();
AntdUI.Chat.MsgItem msgItem4 = new AntdUI.Chat.MsgItem();
win = new AntdUI.WindowBar();
msgList = new AntdUI.Chat.MsgList();
chatList = new AntdUI.Chat.ChatList();
SuspendLayout();
//
// win
//
win.Dock = DockStyle.Top;
win.Location = new Point(0, 0);
win.Name = "win";
win.Size = new Size(745, 36);
win.SubText = "聊天气泡展示";
win.TabIndex = 0;
win.Text = "AntdUI GPT";
//
// msgList
//
msgList.BackColor = Color.White;
msgList.Dock = DockStyle.Left;
msgItem1.Icon = Properties.Resources.aduskin;
msgItem1.Name = "WPF / Flutter UI";
msgItem1.Text = "AduSkin我初三就上班啦";
msgItem1.Time = "10:24";
msgItem2.Count = 999;
msgItem2.Icon = Properties.Resources.av2;
msgItem2.Name = "宝宝";
msgItem2.Text = "今天给你买一束花";
msgItem2.Time = "13:14";
msgItem3.Count = 5;
msgItem3.Icon = Properties.Resources.antd;
msgItem3.Name = "AntdUI";
msgItem3.Select = true;
msgItem3.Text = "Tom❤AntDesign设计语言的Winform界面库";
msgItem3.Time = "前天";
msgItem4.Count = 1;
msgItem4.Icon = Properties.Resources.av1;
msgItem4.Name = "Tom";
msgItem4.Text = "晚上一起 Crazy Day 4";
msgItem4.Time = "疯狂星期四";
msgList.Items.AddRange(new AntdUI.Chat.MsgItem[] { msgItem1, msgItem2, msgItem3, msgItem4 });
msgList.Location = new Point(0, 36);
msgList.Margin = new Padding(2);
msgList.Name = "msgList";
msgList.Size = new Size(246, 392);
msgList.TabIndex = 0;
//
// chatList
//
chatList.Dock = DockStyle.Fill;
chatList.Location = new Point(246, 36);
chatList.Name = "chatList";
chatList.Size = new Size(499, 392);
chatList.TabIndex = 0;
//
// Main
//
ClientSize = new Size(745, 428);
Controls.Add(chatList);
Controls.Add(msgList);
Controls.Add(win);
Font = new Font("Microsoft YaHei UI", 10F, FontStyle.Regular, GraphicsUnit.Point);
Margin = new Padding(2);
Name = "Main";
StartPosition = FormStartPosition.CenterScreen;
Text = "Form1";
ResumeLayout(false);
}
#endregion
private AntdUI.WindowBar win;
private AntdUI.Chat.MsgList msgList;
private AntdUI.Chat.ChatList chatList;
}
}

115
example/ChatUI/Main.cs Normal file
View File

@@ -0,0 +1,115 @@

namespace ChatUI
{
public partial class Main : AntdUI.Window
{
public Main()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Task.Run(() =>
{
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("阿威十八式 🙌🖖🤘👋", Properties.Resources.aduskin, "AduSkin"));
Thread.Sleep(700);
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("搭配 Nuget Tom.HttpLib 可以轻松实现GPT流式传输\n\nhttps://gitee.com/EVA-SS/HttpLib", Properties.Resources.av1, "Tom") { Me = true });
Thread.Sleep(700);
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("估计还是因为长得帅把", Properties.Resources.av1, "Tom") { Me = true });
Thread.Sleep(700);
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("城区这车油耗就是高没啥说的suv本来就不省油", Properties.Resources.aduskin, "AduSkin"));
Thread.Sleep(700);
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("咱这车换个轮眉得多少钱啊", Properties.Resources.av2, "2.0T 银"));
Thread.Sleep(1000);
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("百来块吧", Properties.Resources.av1, "Tom") { Me = true });
Thread.Sleep(2000);
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("我看一般都前端做的winform还没见过", Properties.Resources.av3, "阿枫"));
Thread.Sleep(700);
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("别聊这些\r\n------------------------------", Properties.Resources.av2, "2.0T 银"));
Thread.Sleep(1200);
#region GPT
var msg = new AntdUI.Chat.TextChatItem("", Properties.Resources.av2, "2.0T 银");
bool isbut = chatList.AddIsBottom(msg);
msg.Loading = true;
Thread.Sleep(1200);
if (isbut) chatList.ToBottom();
var strs = new List<string>() {
"It seems like your question",
" contains phrases that are taken from religious or biblical texts, ",
"particularly from the Book of Genesis in the Bible. ",
"To interpret your question, it appears you are asking ",
"about the initial reign and the significance of ",
"the firmament, dominion, and the first tree in the creation ",
"story.\r\n\r\nIn the Book of Genesis, God is depicted as creating the universe and everything in it. ",
"The firmament",
" refers to the sky or ",
"the space that separates the",
" Earth from ",
"the waters above. On ",
"the second day of creation, according to Genesis 1:6-8, God created the firmament",
" to divide the waters below (the seas) from the waters above.\r\n\r\nThe concept of ",
"dominion comes into play on the sixth day of creation when God created humans,",
" as described in Genesis 1:26-28.",
" God gave humans dominion over the fish,",
" birds, and every living",
" creature",
" on the",
" Earth, as well as over the plants and ",
"trees.\r\n\r\nThe first tree mentioned in the Bible is the Tree of ",
"the Knowledge of Good and Evil, which appears in the Garden of Eden story",
" in Genesis 2:9. God commanded Adam, the first human, not to ",
"eat from this tree, warning that doing so would result in death.",
" The Tree of Life is another significant tree mentioned in the Garden of",
" Eden.\r\n\r\nAs for the phrase \"the seas he i were cattle Under living.",
" It may beast every forth place,\" it is unclear what you are asking.",
" However, if you are referring to the creation of living creatures, Genesis",
" 1:20-23 describes how God created aquatic creatures and birds on",
" the fifth day, and land animals and humans on the sixth day." };
string text = string.Join("", strs);
var ran = new Random();
bool run = true;
int i = 0;
while (run)
{
Thread.Sleep(ran.Next(10, 200));
int len = ran.Next(1, 16);
if (text.Length < i + len)
{
len = text.Length - i;
run = false;
}
if (len > 0)
{
msg.Text += text.Substring(i, len);
if (isbut) chatList.ToBottom();
i += len;
}
}
//foreach (var it in strs)
//{
// Thread.Sleep(ran.Next(100, 600));
// msg.Text += it;
// if (isbut) chatList.ToBottom();
//}
msg.Loading = false;
#endregion
});
}
}
}

17
example/ChatUI/Program.cs Normal file
View File

@@ -0,0 +1,17 @@
namespace ChatUI
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.Run(new Main());
}
}
}

View File

@@ -0,0 +1,113 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace ChatUI.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ChatUI.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap aduskin {
get {
object obj = ResourceManager.GetObject("aduskin", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap antd {
get {
object obj = ResourceManager.GetObject("antd", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap av1 {
get {
object obj = ResourceManager.GetObject("av1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap av2 {
get {
object obj = ResourceManager.GetObject("av2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap av3 {
get {
object obj = ResourceManager.GetObject("av3", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="aduskin" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\aduskin.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="antd" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\antd.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="av1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\av1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="av2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\av2.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="av3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\av3.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

View File

@@ -2,13 +2,28 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<ForceDesignerDpiUnaware>true</ForceDesignerDpiUnaware>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<CustomResourceTypesSupport>true</CustomResourceTypesSupport>
<PublishTrimmed>true</PublishTrimmed>
<_SuppressWinFormsTrimError>true</_SuppressWinFormsTrimError>
<PublishAot Condition="'$(Configuration)'=='Release'">true</PublishAot>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WinFormsComInterop" Version="0.4.3" />
<RdXmlFile Include="rd.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\AntdUI\AntdUI.csproj" />
</ItemGroup>

View File

@@ -24,12 +24,14 @@ namespace Overview
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
static void Main(string[] arge)
{
bool istop = false;
if (arge.Length > 0) { if (arge[0] == "t") istop = true; }
//AntdUI.Localization.Provider = new Localizer();
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Main());
Application.Run(new Main(istop));
}
}
public class Localizer : AntdUI.ILocalization

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net7.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
</PropertyGroup>
</Project>

BIN
example/Overview/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

12
example/Overview/rd.xml Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<Directives>
<Application>
<Assembly Name="System.Resources.Extensions">
<Type Name="System.Resources.Extensions.RuntimeResourceSet" Dynamic="Required All" />
<Type Name="System.Resources.Extensions.DeserializingResourceReader" Dynamic="Required All" />
</Assembly>
<Assembly Name="System.Drawing">
<Type Name="System.Drawing.Bitmap" Dynamic="Required All" />
</Assembly>
</Application>
</Directives>