🦄 Beautiful AntdUI

pull/22/head
Tom 2 months ago
parent 144fc5bb98
commit 1373c3d706

@ -0,0 +1,64 @@
// COPYRIGHT (C) Tom. ALL RIGHTS RESERVED.
// THE AntdUI PROJECT IS AN WINFORM LIBRARY LICENSED UNDER THE Apache-2.0 License.
// LICENSED UNDER THE Apache License, VERSION 2.0 (THE "License")
// YOU MAY NOT USE THIS FILE EXCEPT IN COMPLIANCE WITH THE License.
// YOU MAY OBTAIN A COPY OF THE LICENSE AT
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE
// DISTRIBUTED UNDER THE LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING PERMISSIONS AND
// LIMITATIONS UNDER THE License.
// GITEE: https://gitee.com/antdui/AntdUI
// GITHUB: https://github.com/AntdUI/AntdUI
// CSDN: https://blog.csdn.net/v_132
// QQ: 17379620
namespace SVGView
{
public class Localizer : AntdUI.ILocalization
{
public string? GetLocalizedString(string key)
{
switch (key)
{
case "ID":
return "en-US";
case "Cancel":
return "Cancel";
case "OK":
return "OK";
case "Now":
return "Now";
case "ToDay":
return "Today";
case "NoData":
return "No data";
case "ItemsPerPage":
return "Per/Page";
#region SVGView
case "Title":
return "SVG View";
case "Auto":
return "Auto";
case "Zip":
return "Zip";
case "CopyOK":
return "copied";
case "CopyFailed":
return "copy failed";
#endregion
default:
return null;
}
}
}
}

@ -65,6 +65,7 @@ namespace SVGView
windowBar1.Name = "windowBar1";
windowBar1.Size = new Size(800, 36);
windowBar1.TabIndex = 0;
windowBar1.LocalizationText = "Title";
windowBar1.Text = "SVG视图";
//
// button2
@ -76,6 +77,7 @@ namespace SVGView
button2.Name = "button2";
button2.Size = new Size(77, 36);
button2.TabIndex = 1;
button2.LocalizationText = "Auto";
button2.Text = "一键";
button2.Type = AntdUI.TTypeMini.Success;
button2.MouseClick += button2_Click;
@ -88,6 +90,7 @@ namespace SVGView
button1.Name = "button1";
button1.Size = new Size(57, 36);
button1.TabIndex = 0;
button1.LocalizationText = "Zip";
button1.Text = "剔除";
button1.Type = AntdUI.TTypeMini.Primary;
button1.MouseClick += button1_Click;

@ -79,10 +79,10 @@ namespace SVGView
{
try
{
var svg = Clipboard.GetText();
var svg = AntdUI.Helper.ClipboardGetText();
if (string.IsNullOrEmpty(svg)) return;
input1.Text = Hand(svg.Trim(), e.Button == MouseButtons.Right);
Clipboard.SetText(input1.Text);
AntdUI.Helper.ClipboardSetText(input1.Text);
}
catch { }
}

@ -16,6 +16,8 @@
// CSDN: https://blog.csdn.net/v_132
// QQ: 17379620
using System.Runtime.InteropServices;
namespace SVGView
{
internal static class Program
@ -26,9 +28,13 @@ namespace SVGView
[STAThread]
static void Main()
{
ComWrappers.RegisterForMarshalling(WinFormsComInterop.WinFormsComWrappers.Instance);
AntdUI.Config.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.SetCompatibleTextRenderingDefault(false);
AntdUI.Localization.DefaultLanguage = "zh-CN";
var lang = AntdUI.Localization.CurrentLanguage;
if (lang.StartsWith("en")) AntdUI.Localization.Provider = new Localizer();
Application.Run(new Main());
}
}

@ -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\SVGView\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net9.0-windows</TargetFramework>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>true</SelfContained>
</PropertyGroup>
</Project>

@ -2,13 +2,31 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net9.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<ForceDesignerDpiUnaware>true</ForceDesignerDpiUnaware>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<WindowsSupportedOSPlatformVersion>5.1</WindowsSupportedOSPlatformVersion>
<TargetPlatformMinVersion>5.1</TargetPlatformMinVersion>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<CustomResourceTypesSupport>true</CustomResourceTypesSupport>
<PublishTrimmed>true</PublishTrimmed>
<_SuppressWinFormsTrimError>true</_SuppressWinFormsTrimError>
<PublishAot>true</PublishAot>
<OptimizationPreference>Size</OptimizationPreference>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="VC-LTL" Version="5.1.1" />
<PackageReference Include="WinFormsComInterop" Version="0.5.0" />
<PackageReference Include="YY-Thunks" Version="1.1.4" />
<RdXmlFile Include="rd.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\AntdUI\AntdUI.csproj" />
</ItemGroup>

@ -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>
Loading…
Cancel
Save