添加Alert, Tree
This commit is contained in:
parent
6aa75ffede
commit
9390e7ce8a
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<TargetFrameworks>net48;net8.0-windows</TargetFrameworks>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ApplicationHighDpiMode>SystemAware</ApplicationHighDpiMode>
|
||||
<ForceDesignerDpiUnaware>true</ForceDesignerDpiUnaware>
|
||||
@ -32,13 +32,10 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AntdUI" Version="1.5.7" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NLog" Version="5.3.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Configuration" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
@ -55,13 +52,12 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="appsettings.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="NLog.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Views\Test\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@ -1,4 +1,5 @@
|
||||
using AntdUI;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using AntdUIDemo.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -10,6 +11,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
|
||||
namespace AntdUIDemo.Controls
|
||||
{
|
||||
@ -40,8 +42,15 @@ namespace AntdUIDemo.Controls
|
||||
private void InitData()
|
||||
{
|
||||
tabs.SelectedIndex = 0;
|
||||
//色彩模式
|
||||
var colormode = ConfigurationManager.AppSettings["ColorMode"];
|
||||
|
||||
// 读取 appsettings.json 文件
|
||||
var configFilePath = "appsettings.json";
|
||||
var json = File.ReadAllText(configFilePath);
|
||||
var jsonObj = JObject.Parse(json);
|
||||
var appSettings = jsonObj["AppSettings"];
|
||||
|
||||
// 色彩模式
|
||||
var colormode = appSettings["ColorMode"]?.ToString();
|
||||
var modeIndexMapping = new Dictionary<string, int>
|
||||
{
|
||||
{ "Dark", 2 },
|
||||
@ -51,21 +60,26 @@ namespace AntdUIDemo.Controls
|
||||
select_colormode.SelectedIndex = modeIndexMapping.ContainsKey(colormode)
|
||||
? modeIndexMapping[colormode]
|
||||
: 0;
|
||||
//开启动画
|
||||
var animation = ConfigurationManager.AppSettings["Animation"];
|
||||
|
||||
// 开启动画
|
||||
var animation = appSettings["Animation"]?.ToString();
|
||||
switch_animation.Checked = animation == "True";
|
||||
//启用阴影
|
||||
var shadow = ConfigurationManager.AppSettings["ShadowEnabled"];
|
||||
|
||||
// 启用阴影
|
||||
var shadow = appSettings["ShadowEnabled"]?.ToString();
|
||||
switch_shadow.Checked = shadow == "True";
|
||||
//隐藏滚动条
|
||||
var scrollbar = ConfigurationManager.AppSettings["ScrollBarHide"];
|
||||
|
||||
// 隐藏滚动条
|
||||
var scrollbar = appSettings["ScrollBarHide"]?.ToString();
|
||||
switch_scrollbar.Checked = scrollbar == "True";
|
||||
//消息窗口弹出
|
||||
var showinwindow = ConfigurationManager.AppSettings["ShowInWindow"];
|
||||
|
||||
// 消息窗口弹出
|
||||
var showinwindow = appSettings["ShowInWindow"]?.ToString();
|
||||
switch_showinwindow.Checked = showinwindow == "True";
|
||||
//消息偏移
|
||||
var offset = ConfigurationManager.AppSettings["ShowOffset"];
|
||||
input_offset.Value = decimal.Parse(offset);
|
||||
|
||||
// 消息偏移
|
||||
var offset = appSettings["ShowOffset"]?.ToString();
|
||||
input_offset.Value = decimal.Parse(offset ?? "0");
|
||||
}
|
||||
|
||||
#region 事件
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using AntdUI;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using AntdUIDemo.Controls;
|
||||
using AntdUIDemo.Models;
|
||||
using AntdUIDemo.Utils;
|
||||
@ -8,6 +9,7 @@ using System;
|
||||
using System.Configuration;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
|
||||
namespace AntdUIDemo
|
||||
{
|
||||
@ -45,8 +47,14 @@ namespace AntdUIDemo
|
||||
|
||||
private void LoadAppConfig()
|
||||
{
|
||||
//加载色彩模式
|
||||
var value = ConfigurationManager.AppSettings["ColorMode"];
|
||||
// 读取 appsettings.json 文件
|
||||
var configFilePath = "appsettings.json";
|
||||
var json = File.ReadAllText(configFilePath);
|
||||
var jsonObj = JObject.Parse(json);
|
||||
var appSettings = jsonObj["AppSettings"];
|
||||
|
||||
// 加载色彩模式
|
||||
var value = appSettings["ColorMode"]?.ToString();
|
||||
if (value == "Auto")
|
||||
{
|
||||
ThemeHelper.SetColorMode(this, ThemeHelper.IsLightMode());
|
||||
@ -55,20 +63,25 @@ namespace AntdUIDemo
|
||||
{
|
||||
ThemeHelper.SetColorMode(this, value == "Light");
|
||||
}
|
||||
//加载动画
|
||||
var animation = ConfigurationManager.AppSettings["Animation"];
|
||||
|
||||
// 加载动画
|
||||
var animation = appSettings["Animation"]?.ToString();
|
||||
AntdUI.Config.Animation = animation == "True";
|
||||
//加载阴影
|
||||
var shadow = ConfigurationManager.AppSettings["ShadowEnabled"];
|
||||
|
||||
// 加载阴影
|
||||
var shadow = appSettings["ShadowEnabled"]?.ToString();
|
||||
AntdUI.Config.ShadowEnabled = shadow == "True";
|
||||
//滚动条
|
||||
var scrollbar = ConfigurationManager.AppSettings["ScrollBarHide"];
|
||||
|
||||
// 滚动条
|
||||
var scrollbar = appSettings["ScrollBarHide"]?.ToString();
|
||||
AntdUI.Config.ScrollBarHide = scrollbar == "True";
|
||||
//窗口内弹出 Message/Notification
|
||||
var popup = ConfigurationManager.AppSettings["ShowInWindow"];
|
||||
|
||||
// 窗口内弹出 Message/Notification
|
||||
var popup = appSettings["ShowInWindow"]?.ToString();
|
||||
AntdUI.Config.ShowInWindow = popup == "True";
|
||||
//通知消息边界偏移量XY(Message/Notification)
|
||||
var messageOffset = ConfigurationManager.AppSettings["NoticeWindowOffsetXY"];
|
||||
|
||||
// 通知消息边界偏移量XY(Message/Notification)
|
||||
var messageOffset = appSettings["NoticeWindowOffsetXY"]?.ToString();
|
||||
AntdUI.Config.NoticeWindowOffsetXY = Convert.ToInt32(messageOffset);
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
@ -10,53 +11,57 @@ namespace AntdUIDemo.Utils
|
||||
{
|
||||
public static class AppSetting
|
||||
{
|
||||
private static readonly string configFilePath = "appsettings.json";
|
||||
|
||||
public static void UpdateAppSetting(string key, string value)
|
||||
{
|
||||
// 获取配置文件路径
|
||||
string configFilePath = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
|
||||
|
||||
// 检查配置文件是否存在
|
||||
if (!File.Exists(configFilePath))
|
||||
{
|
||||
// 如果文件不存在,可以选择创建默认的配置文件
|
||||
// 如果文件不存在,创建默认的配置文件
|
||||
CreateDefaultConfigFile(configFilePath);
|
||||
}
|
||||
// 获取当前配置文件
|
||||
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
|
||||
|
||||
// 检查key是否存在,存在则更新,不存在则添加
|
||||
if (config.AppSettings.Settings[key] != null)
|
||||
// 读取并解析现有的 appsettings.json 文件
|
||||
var json = File.ReadAllText(configFilePath);
|
||||
var jsonObj = JObject.Parse(json);
|
||||
|
||||
// 获取或创建 "AppSettings" 节点
|
||||
var appSettings = jsonObj["AppSettings"] as JObject;
|
||||
if (appSettings == null)
|
||||
{
|
||||
config.AppSettings.Settings[key].Value = value;
|
||||
appSettings = new JObject();
|
||||
jsonObj["AppSettings"] = appSettings;
|
||||
}
|
||||
|
||||
// 检查 key 是否存在,存在则更新,不存在则添加
|
||||
if (appSettings[key] != null)
|
||||
{
|
||||
appSettings[key] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
config.AppSettings.Settings.Add(key, value);
|
||||
appSettings.Add(key, value);
|
||||
}
|
||||
|
||||
// 保存更改
|
||||
config.Save(ConfigurationSaveMode.Modified);
|
||||
|
||||
// 刷新配置节,确保更新被应用
|
||||
ConfigurationManager.RefreshSection("appSettings");
|
||||
// 保存更改回 appsettings.json 文件
|
||||
File.WriteAllText(configFilePath, jsonObj.ToString());
|
||||
}
|
||||
|
||||
private static void CreateDefaultConfigFile(string configFilePath)
|
||||
{
|
||||
// 创建一个新的配置文件,并写入默认的appSettings
|
||||
var configXml = @"<?xml version='1.0' encoding='utf-8' ?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<add key='ColorMode' value='Auto' />
|
||||
<add key='Animation' value='True' />
|
||||
<add key='ShadowEnabled' value='True' />
|
||||
<add key='ScrollBarHide' value='False' />
|
||||
<add key='ShowInWindow' value='True' />
|
||||
<add key='ShowOffset' value='0' />
|
||||
</appSettings>
|
||||
</configuration>";
|
||||
|
||||
File.WriteAllText(configFilePath, configXml);
|
||||
// 创建一个新的 appsettings.json 文件,并写入默认的 AppSettings
|
||||
var configJson = @"{
|
||||
""AppSettings"": {
|
||||
""ColorMode"": ""Auto"",
|
||||
""Animation"": ""True"",
|
||||
""ShadowEnabled"": ""True"",
|
||||
""ScrollBarHide"": ""False"",
|
||||
""ShowInWindow"": ""True"",
|
||||
""ShowOffset"": ""0""
|
||||
}
|
||||
}";
|
||||
File.WriteAllText(configFilePath, configJson);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
317
Views/AlertDemo.Designer.cs
generated
Normal file
317
Views/AlertDemo.Designer.cs
generated
Normal file
@ -0,0 +1,317 @@
|
||||
namespace AntdUIDemo.Views
|
||||
{
|
||||
partial class AlertDemo
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.stackPanel1 = new AntdUI.StackPanel();
|
||||
this.flowPanel3 = new AntdUI.FlowPanel();
|
||||
this.alert12 = new AntdUI.Alert();
|
||||
this.label5 = new AntdUI.Label();
|
||||
this.flowPanel1 = new AntdUI.FlowPanel();
|
||||
this.alert5 = new AntdUI.Alert();
|
||||
this.alert6 = new AntdUI.Alert();
|
||||
this.alert7 = new AntdUI.Alert();
|
||||
this.alert8 = new AntdUI.Alert();
|
||||
this.label4 = new AntdUI.Label();
|
||||
this.flowPanel2 = new AntdUI.FlowPanel();
|
||||
this.alert4 = new AntdUI.Alert();
|
||||
this.alert3 = new AntdUI.Alert();
|
||||
this.alert2 = new AntdUI.Alert();
|
||||
this.alert1 = new AntdUI.Alert();
|
||||
this.label3 = new AntdUI.Label();
|
||||
this.divider1 = new AntdUI.Divider();
|
||||
this.label2 = new AntdUI.Label();
|
||||
this.label1 = new AntdUI.Label();
|
||||
this.label6 = new AntdUI.Label();
|
||||
this.alert9 = new AntdUI.Alert();
|
||||
this.stackPanel1.SuspendLayout();
|
||||
this.flowPanel3.SuspendLayout();
|
||||
this.flowPanel1.SuspendLayout();
|
||||
this.flowPanel2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// stackPanel1
|
||||
//
|
||||
this.stackPanel1.Controls.Add(this.alert9);
|
||||
this.stackPanel1.Controls.Add(this.label6);
|
||||
this.stackPanel1.Controls.Add(this.flowPanel3);
|
||||
this.stackPanel1.Controls.Add(this.label5);
|
||||
this.stackPanel1.Controls.Add(this.flowPanel1);
|
||||
this.stackPanel1.Controls.Add(this.label4);
|
||||
this.stackPanel1.Controls.Add(this.flowPanel2);
|
||||
this.stackPanel1.Controls.Add(this.label3);
|
||||
this.stackPanel1.Controls.Add(this.divider1);
|
||||
this.stackPanel1.Controls.Add(this.label2);
|
||||
this.stackPanel1.Controls.Add(this.label1);
|
||||
this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.stackPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.stackPanel1.Name = "stackPanel1";
|
||||
this.stackPanel1.Size = new System.Drawing.Size(700, 505);
|
||||
this.stackPanel1.TabIndex = 0;
|
||||
this.stackPanel1.Text = "stackPanel1";
|
||||
this.stackPanel1.Vertical = true;
|
||||
//
|
||||
// flowPanel3
|
||||
//
|
||||
this.flowPanel3.Controls.Add(this.alert12);
|
||||
this.flowPanel3.Location = new System.Drawing.Point(3, 275);
|
||||
this.flowPanel3.Name = "flowPanel3";
|
||||
this.flowPanel3.Size = new System.Drawing.Size(694, 76);
|
||||
this.flowPanel3.TabIndex = 43;
|
||||
this.flowPanel3.Text = "flowPanel3";
|
||||
//
|
||||
// alert12
|
||||
//
|
||||
this.alert12.BorderWidth = 2F;
|
||||
this.alert12.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.alert12.Icon = AntdUI.TType.Success;
|
||||
this.alert12.Location = new System.Drawing.Point(3, 3);
|
||||
this.alert12.Name = "alert12";
|
||||
this.alert12.Size = new System.Drawing.Size(498, 70);
|
||||
this.alert12.TabIndex = 0;
|
||||
this.alert12.Text = "Success Description Success Description Success Description";
|
||||
this.alert12.TextTitle = "Success Text";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label5.Location = new System.Drawing.Point(3, 245);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(694, 24);
|
||||
this.label5.TabIndex = 42;
|
||||
this.label5.Text = "副文本";
|
||||
//
|
||||
// flowPanel1
|
||||
//
|
||||
this.flowPanel1.Controls.Add(this.alert5);
|
||||
this.flowPanel1.Controls.Add(this.alert6);
|
||||
this.flowPanel1.Controls.Add(this.alert7);
|
||||
this.flowPanel1.Controls.Add(this.alert8);
|
||||
this.flowPanel1.Location = new System.Drawing.Point(3, 201);
|
||||
this.flowPanel1.Name = "flowPanel1";
|
||||
this.flowPanel1.Size = new System.Drawing.Size(694, 38);
|
||||
this.flowPanel1.TabIndex = 41;
|
||||
this.flowPanel1.Text = "flowPanel1";
|
||||
//
|
||||
// alert5
|
||||
//
|
||||
this.alert5.BorderWidth = 2F;
|
||||
this.alert5.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.alert5.Icon = AntdUI.TType.Error;
|
||||
this.alert5.Location = new System.Drawing.Point(381, 3);
|
||||
this.alert5.Name = "alert5";
|
||||
this.alert5.Size = new System.Drawing.Size(120, 32);
|
||||
this.alert5.TabIndex = 3;
|
||||
this.alert5.Text = "Error Text";
|
||||
//
|
||||
// alert6
|
||||
//
|
||||
this.alert6.BorderWidth = 2F;
|
||||
this.alert6.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.alert6.Icon = AntdUI.TType.Warn;
|
||||
this.alert6.Location = new System.Drawing.Point(255, 3);
|
||||
this.alert6.Name = "alert6";
|
||||
this.alert6.Size = new System.Drawing.Size(120, 32);
|
||||
this.alert6.TabIndex = 2;
|
||||
this.alert6.Text = "Warn Text";
|
||||
//
|
||||
// alert7
|
||||
//
|
||||
this.alert7.BorderWidth = 2F;
|
||||
this.alert7.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.alert7.Icon = AntdUI.TType.Info;
|
||||
this.alert7.Location = new System.Drawing.Point(129, 3);
|
||||
this.alert7.Name = "alert7";
|
||||
this.alert7.Size = new System.Drawing.Size(120, 32);
|
||||
this.alert7.TabIndex = 1;
|
||||
this.alert7.Text = "Info Text";
|
||||
//
|
||||
// alert8
|
||||
//
|
||||
this.alert8.BorderWidth = 2F;
|
||||
this.alert8.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.alert8.Icon = AntdUI.TType.Success;
|
||||
this.alert8.Location = new System.Drawing.Point(3, 3);
|
||||
this.alert8.Name = "alert8";
|
||||
this.alert8.Size = new System.Drawing.Size(120, 32);
|
||||
this.alert8.TabIndex = 0;
|
||||
this.alert8.Text = "Success Text";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label4.Location = new System.Drawing.Point(3, 171);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(694, 24);
|
||||
this.label4.TabIndex = 40;
|
||||
this.label4.Text = "提示边框";
|
||||
//
|
||||
// flowPanel2
|
||||
//
|
||||
this.flowPanel2.Controls.Add(this.alert4);
|
||||
this.flowPanel2.Controls.Add(this.alert3);
|
||||
this.flowPanel2.Controls.Add(this.alert2);
|
||||
this.flowPanel2.Controls.Add(this.alert1);
|
||||
this.flowPanel2.Location = new System.Drawing.Point(3, 127);
|
||||
this.flowPanel2.Name = "flowPanel2";
|
||||
this.flowPanel2.Size = new System.Drawing.Size(694, 38);
|
||||
this.flowPanel2.TabIndex = 39;
|
||||
this.flowPanel2.Text = "flowPanel2";
|
||||
//
|
||||
// alert4
|
||||
//
|
||||
this.alert4.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.alert4.Icon = AntdUI.TType.Error;
|
||||
this.alert4.Location = new System.Drawing.Point(381, 3);
|
||||
this.alert4.Name = "alert4";
|
||||
this.alert4.Size = new System.Drawing.Size(120, 32);
|
||||
this.alert4.TabIndex = 3;
|
||||
this.alert4.Text = "Error Text";
|
||||
//
|
||||
// alert3
|
||||
//
|
||||
this.alert3.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.alert3.Icon = AntdUI.TType.Warn;
|
||||
this.alert3.Location = new System.Drawing.Point(255, 3);
|
||||
this.alert3.Name = "alert3";
|
||||
this.alert3.Size = new System.Drawing.Size(120, 32);
|
||||
this.alert3.TabIndex = 2;
|
||||
this.alert3.Text = "Warn Text";
|
||||
//
|
||||
// alert2
|
||||
//
|
||||
this.alert2.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.alert2.Icon = AntdUI.TType.Info;
|
||||
this.alert2.Location = new System.Drawing.Point(129, 3);
|
||||
this.alert2.Name = "alert2";
|
||||
this.alert2.Size = new System.Drawing.Size(120, 32);
|
||||
this.alert2.TabIndex = 1;
|
||||
this.alert2.Text = "Info Text";
|
||||
//
|
||||
// alert1
|
||||
//
|
||||
this.alert1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.alert1.Icon = AntdUI.TType.Success;
|
||||
this.alert1.Location = new System.Drawing.Point(3, 3);
|
||||
this.alert1.Name = "alert1";
|
||||
this.alert1.Size = new System.Drawing.Size(120, 32);
|
||||
this.alert1.TabIndex = 0;
|
||||
this.alert1.Text = "Success Text";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label3.Location = new System.Drawing.Point(3, 97);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(694, 24);
|
||||
this.label3.TabIndex = 21;
|
||||
this.label3.Text = "基本用法";
|
||||
//
|
||||
// divider1
|
||||
//
|
||||
this.divider1.Location = new System.Drawing.Point(3, 79);
|
||||
this.divider1.Name = "divider1";
|
||||
this.divider1.Size = new System.Drawing.Size(694, 12);
|
||||
this.divider1.TabIndex = 20;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label2.Location = new System.Drawing.Point(3, 49);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(694, 24);
|
||||
this.label2.TabIndex = 19;
|
||||
this.label2.Text = "警告提示,展现需要关注的信息。";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label1.Location = new System.Drawing.Point(3, 3);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(694, 40);
|
||||
this.label1.TabIndex = 18;
|
||||
this.label1.Text = "Alert 警告提示";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label6.Location = new System.Drawing.Point(3, 357);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(694, 24);
|
||||
this.label6.TabIndex = 44;
|
||||
this.label6.Text = "轮播";
|
||||
//
|
||||
// alert9
|
||||
//
|
||||
this.alert9.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.alert9.Location = new System.Drawing.Point(3, 387);
|
||||
this.alert9.Loop = true;
|
||||
this.alert9.Name = "alert9";
|
||||
this.alert9.Size = new System.Drawing.Size(694, 32);
|
||||
this.alert9.TabIndex = 45;
|
||||
this.alert9.Text = "I can be a React component, multiple React components, or just some text.";
|
||||
//
|
||||
// AlertDemo
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
|
||||
this.Controls.Add(this.stackPanel1);
|
||||
this.Name = "AlertDemo";
|
||||
this.Size = new System.Drawing.Size(700, 505);
|
||||
this.stackPanel1.ResumeLayout(false);
|
||||
this.flowPanel3.ResumeLayout(false);
|
||||
this.flowPanel1.ResumeLayout(false);
|
||||
this.flowPanel2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private AntdUI.StackPanel stackPanel1;
|
||||
private AntdUI.Divider divider1;
|
||||
private AntdUI.Label label2;
|
||||
private AntdUI.Label label1;
|
||||
private AntdUI.Label label3;
|
||||
private AntdUI.FlowPanel flowPanel2;
|
||||
private AntdUI.Alert alert1;
|
||||
private AntdUI.Alert alert4;
|
||||
private AntdUI.Alert alert3;
|
||||
private AntdUI.Alert alert2;
|
||||
private AntdUI.FlowPanel flowPanel1;
|
||||
private AntdUI.Alert alert5;
|
||||
private AntdUI.Alert alert6;
|
||||
private AntdUI.Alert alert7;
|
||||
private AntdUI.Alert alert8;
|
||||
private AntdUI.Label label4;
|
||||
private AntdUI.FlowPanel flowPanel3;
|
||||
private AntdUI.Alert alert12;
|
||||
private AntdUI.Label label5;
|
||||
private AntdUI.Label label6;
|
||||
private AntdUI.Alert alert9;
|
||||
}
|
||||
}
|
||||
20
Views/AlertDemo.cs
Normal file
20
Views/AlertDemo.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AntdUIDemo.Views
|
||||
{
|
||||
public partial class AlertDemo : UserControl
|
||||
{
|
||||
public AlertDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Views/AlertDemo.resx
Normal file
120
Views/AlertDemo.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
</root>
|
||||
115
Views/TreeDemo.Designer.cs
generated
115
Views/TreeDemo.Designer.cs
generated
@ -28,25 +28,26 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AntdUI.TreeItem treeItem7 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem8 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem9 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem10 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem11 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem12 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem1 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem2 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem3 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem4 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem5 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem6 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem7 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem8 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem9 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem10 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem11 = new AntdUI.TreeItem();
|
||||
AntdUI.TreeItem treeItem12 = new AntdUI.TreeItem();
|
||||
this.stackPanel1 = new AntdUI.StackPanel();
|
||||
this.divider1 = new AntdUI.Divider();
|
||||
this.label2 = new AntdUI.Label();
|
||||
this.label1 = new AntdUI.Label();
|
||||
this.label3 = new AntdUI.Label();
|
||||
this.stackPanel2 = new AntdUI.StackPanel();
|
||||
this.tree1 = new AntdUI.Tree();
|
||||
this.tree2 = new AntdUI.Tree();
|
||||
this.tree1 = new AntdUI.Tree();
|
||||
this.stackPanel1.SuspendLayout();
|
||||
this.stackPanel2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
@ -54,6 +55,7 @@
|
||||
// stackPanel1
|
||||
//
|
||||
this.stackPanel1.Controls.Add(this.stackPanel2);
|
||||
this.stackPanel1.Controls.Add(this.label3);
|
||||
this.stackPanel1.Controls.Add(this.divider1);
|
||||
this.stackPanel1.Controls.Add(this.label2);
|
||||
this.stackPanel1.Controls.Add(this.label1);
|
||||
@ -90,56 +92,25 @@
|
||||
this.label1.TabIndex = 12;
|
||||
this.label1.Text = "Tree 树形控件";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label3.Location = new System.Drawing.Point(3, 97);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(694, 24);
|
||||
this.label3.TabIndex = 16;
|
||||
this.label3.Text = "基本用法";
|
||||
//
|
||||
// stackPanel2
|
||||
//
|
||||
this.stackPanel2.Controls.Add(this.tree2);
|
||||
this.stackPanel2.Controls.Add(this.tree1);
|
||||
this.stackPanel2.Location = new System.Drawing.Point(3, 97);
|
||||
this.stackPanel2.Location = new System.Drawing.Point(3, 127);
|
||||
this.stackPanel2.Name = "stackPanel2";
|
||||
this.stackPanel2.Size = new System.Drawing.Size(694, 377);
|
||||
this.stackPanel2.TabIndex = 15;
|
||||
this.stackPanel2.Size = new System.Drawing.Size(694, 347);
|
||||
this.stackPanel2.TabIndex = 17;
|
||||
this.stackPanel2.Text = "stackPanel2";
|
||||
//
|
||||
// tree1
|
||||
//
|
||||
this.tree1.Checkable = true;
|
||||
this.tree1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
|
||||
treeItem7.Expand = true;
|
||||
treeItem7.PARENTITEM = null;
|
||||
treeItem8.Checked = true;
|
||||
treeItem8.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
treeItem8.Enabled = false;
|
||||
treeItem8.Expand = true;
|
||||
treeItem8.PARENTITEM = treeItem7;
|
||||
treeItem9.Expand = true;
|
||||
treeItem9.PARENTITEM = treeItem8;
|
||||
treeItem9.Text = "leaf";
|
||||
treeItem10.PARENTITEM = treeItem8;
|
||||
treeItem10.Text = "leaf";
|
||||
treeItem8.Sub.Add(treeItem9);
|
||||
treeItem8.Sub.Add(treeItem10);
|
||||
treeItem8.Text = "parent1-0";
|
||||
treeItem11.Checked = true;
|
||||
treeItem11.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
treeItem11.Expand = true;
|
||||
treeItem11.PARENTITEM = treeItem7;
|
||||
treeItem12.Checked = true;
|
||||
treeItem12.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
treeItem12.Expand = true;
|
||||
treeItem12.PARENTITEM = treeItem11;
|
||||
treeItem12.Text = "sss";
|
||||
treeItem11.Sub.Add(treeItem12);
|
||||
treeItem11.Text = "parent1-1";
|
||||
treeItem7.Sub.Add(treeItem8);
|
||||
treeItem7.Sub.Add(treeItem11);
|
||||
treeItem7.Text = "parent1";
|
||||
this.tree1.Items.Add(treeItem7);
|
||||
this.tree1.Location = new System.Drawing.Point(3, 3);
|
||||
this.tree1.Name = "tree1";
|
||||
this.tree1.Size = new System.Drawing.Size(247, 371);
|
||||
this.tree1.TabIndex = 0;
|
||||
this.tree1.Text = "tree1";
|
||||
//
|
||||
// tree2
|
||||
//
|
||||
this.tree2.BlockNode = true;
|
||||
@ -175,10 +146,49 @@
|
||||
this.tree2.Items.Add(treeItem1);
|
||||
this.tree2.Location = new System.Drawing.Point(256, 3);
|
||||
this.tree2.Name = "tree2";
|
||||
this.tree2.Size = new System.Drawing.Size(247, 371);
|
||||
this.tree2.Size = new System.Drawing.Size(247, 341);
|
||||
this.tree2.TabIndex = 1;
|
||||
this.tree2.Text = "tree2";
|
||||
//
|
||||
// tree1
|
||||
//
|
||||
this.tree1.Checkable = true;
|
||||
this.tree1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
|
||||
treeItem7.CheckState = System.Windows.Forms.CheckState.Indeterminate;
|
||||
treeItem7.Expand = true;
|
||||
treeItem7.PARENTITEM = null;
|
||||
treeItem8.Enabled = false;
|
||||
treeItem8.Expand = true;
|
||||
treeItem8.PARENTITEM = treeItem7;
|
||||
treeItem9.Expand = true;
|
||||
treeItem9.PARENTITEM = treeItem8;
|
||||
treeItem9.Text = "leaf";
|
||||
treeItem10.PARENTITEM = treeItem8;
|
||||
treeItem10.Text = "leaf";
|
||||
treeItem8.Sub.Add(treeItem9);
|
||||
treeItem8.Sub.Add(treeItem10);
|
||||
treeItem8.Text = "parent1-0";
|
||||
treeItem11.Checked = true;
|
||||
treeItem11.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
treeItem11.Expand = true;
|
||||
treeItem11.PARENTITEM = treeItem7;
|
||||
treeItem12.Checked = true;
|
||||
treeItem12.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
treeItem12.Expand = true;
|
||||
treeItem12.PARENTITEM = treeItem11;
|
||||
treeItem12.Text = "sss";
|
||||
treeItem11.Sub.Add(treeItem12);
|
||||
treeItem11.Text = "parent1-1";
|
||||
treeItem7.Sub.Add(treeItem8);
|
||||
treeItem7.Sub.Add(treeItem11);
|
||||
treeItem7.Text = "parent1";
|
||||
this.tree1.Items.Add(treeItem7);
|
||||
this.tree1.Location = new System.Drawing.Point(3, 3);
|
||||
this.tree1.Name = "tree1";
|
||||
this.tree1.Size = new System.Drawing.Size(247, 341);
|
||||
this.tree1.TabIndex = 0;
|
||||
this.tree1.Text = "tree1";
|
||||
//
|
||||
// TreeDemo
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
|
||||
@ -198,7 +208,8 @@
|
||||
private AntdUI.Label label2;
|
||||
private AntdUI.Label label1;
|
||||
private AntdUI.StackPanel stackPanel2;
|
||||
private AntdUI.Tree tree1;
|
||||
private AntdUI.Tree tree2;
|
||||
private AntdUI.Tree tree1;
|
||||
private AntdUI.Label label3;
|
||||
}
|
||||
}
|
||||
|
||||
10
appsettings.json
Normal file
10
appsettings.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"AppSettings": {
|
||||
"ColorMode": "Auto",
|
||||
"Animation": "True",
|
||||
"ShadowEnabled": "True",
|
||||
"ScrollBarHide": "False",
|
||||
"ShowInWindow": "True",
|
||||
"ShowOffset": 0
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user