浏览代码

Toast提示框增加文本长度自动增长支持

yuzhengyang 7 年之前
父节点
当前提交
5bfb76c3bf

二进制
Azylee.Utils/.vs/Azylee.Utils/v15/Server/sqlite3/storage.ide


+ 7 - 0
Azylee.Utils/Azylee.Utils.sln

@@ -29,6 +29,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.YeahWeb", "Tests\Test.
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azylee.DB.SQLite", "Azylee.DB.SQLite\Azylee.DB.SQLite.csproj", "{A77DBB5D-CA37-425C-8FA2-8B0736AE1C4D}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.Toast", "Tests\Test.Toast\Test.Toast.csproj", "{576CFDD2-150A-4D0C-874A-730265537902}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -79,6 +81,10 @@ Global
 		{A77DBB5D-CA37-425C-8FA2-8B0736AE1C4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{A77DBB5D-CA37-425C-8FA2-8B0736AE1C4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{A77DBB5D-CA37-425C-8FA2-8B0736AE1C4D}.Release|Any CPU.Build.0 = Release|Any CPU
+		{576CFDD2-150A-4D0C-874A-730265537902}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{576CFDD2-150A-4D0C-874A-730265537902}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{576CFDD2-150A-4D0C-874A-730265537902}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{576CFDD2-150A-4D0C-874A-730265537902}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -94,6 +100,7 @@ Global
 		{5FB93D25-8855-4A80-9E08-131BC728B7F4} = {9351FC10-E8D0-41BB-A813-0B5B3EA90605}
 		{0213B9D4-1B4A-4BDE-9CE9-228C68A9A522} = {9351FC10-E8D0-41BB-A813-0B5B3EA90605}
 		{A77DBB5D-CA37-425C-8FA2-8B0736AE1C4D} = {927325CD-24FD-4B85-A982-543D4F58A47C}
+		{576CFDD2-150A-4D0C-874A-730265537902} = {9351FC10-E8D0-41BB-A813-0B5B3EA90605}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {3A021A3E-4C98-47CD-B4E8-912E12611C2E}

+ 80 - 23
Azylee.Utils/Azylee.WinformSkin/FormUI/Toast/ToastForm.Designer.cs

@@ -35,41 +35,52 @@
             this.TMHide = new System.Windows.Forms.Timer(this.components);
             this.TMHideAnim = new System.Windows.Forms.Timer(this.components);
             this.TMShowAnim = new System.Windows.Forms.Timer(this.components);
-            this.panel1 = new System.Windows.Forms.Panel();
+            this.PNMain = new System.Windows.Forms.Panel();
+            this.PNContainer = new System.Windows.Forms.Panel();
+            this.PNText = new System.Windows.Forms.Panel();
+            this.PNTitle = new System.Windows.Forms.Panel();
+            this.PNIcon = new System.Windows.Forms.Panel();
             ((System.ComponentModel.ISupportInitialize)(this.PBIcon)).BeginInit();
-            this.panel1.SuspendLayout();
+            this.PNMain.SuspendLayout();
+            this.PNContainer.SuspendLayout();
+            this.PNText.SuspendLayout();
+            this.PNTitle.SuspendLayout();
+            this.PNIcon.SuspendLayout();
             this.SuspendLayout();
             // 
             // PBIcon
             // 
             this.PBIcon.BackColor = System.Drawing.Color.Transparent;
+            this.PBIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.PBIcon.Image = global::Azylee.WinformSkin.Properties.Resources.toast_warning;
-            this.PBIcon.Location = new System.Drawing.Point(16, 16);
+            this.PBIcon.Location = new System.Drawing.Point(13, 16);
             this.PBIcon.Name = "PBIcon";
             this.PBIcon.Size = new System.Drawing.Size(42, 41);
-            this.PBIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+            this.PBIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
             this.PBIcon.TabIndex = 4;
             this.PBIcon.TabStop = false;
             this.PBIcon.Click += new System.EventHandler(this.PBIcon_Click);
             // 
             // LBTitle
             // 
+            this.LBTitle.Dock = System.Windows.Forms.DockStyle.Fill;
             this.LBTitle.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.LBTitle.ForeColor = System.Drawing.Color.White;
-            this.LBTitle.Location = new System.Drawing.Point(68, 7);
+            this.LBTitle.Location = new System.Drawing.Point(3, 3);
             this.LBTitle.Name = "LBTitle";
-            this.LBTitle.Size = new System.Drawing.Size(270, 20);
+            this.LBTitle.Size = new System.Drawing.Size(288, 20);
             this.LBTitle.TabIndex = 5;
             this.LBTitle.Text = "测试标题测试标题测试标题测试标题";
             this.LBTitle.Click += new System.EventHandler(this.LBTitle_Click);
             // 
             // LBText
             // 
+            this.LBText.Dock = System.Windows.Forms.DockStyle.Fill;
             this.LBText.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.LBText.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(155)))), ((int)(((byte)(155)))));
-            this.LBText.Location = new System.Drawing.Point(68, 30);
+            this.LBText.Location = new System.Drawing.Point(3, 3);
             this.LBText.Name = "LBText";
-            this.LBText.Size = new System.Drawing.Size(270, 44);
+            this.LBText.Size = new System.Drawing.Size(288, 52);
             this.LBText.TabIndex = 6;
             this.LBText.Text = "测试,内容。测试,内容。测试,内容。测试,内容。测试,内容。测试,内容。";
             this.LBText.Click += new System.EventHandler(this.LBText_Click);
@@ -88,16 +99,55 @@
             this.TMShowAnim.Interval = 10;
             this.TMShowAnim.Tick += new System.EventHandler(this.TMShowAnim_Tick);
             // 
-            // panel1
-            // 
-            this.panel1.Controls.Add(this.PBIcon);
-            this.panel1.Controls.Add(this.LBTitle);
-            this.panel1.Controls.Add(this.LBText);
-            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.panel1.Location = new System.Drawing.Point(0, 0);
-            this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(360, 80);
-            this.panel1.TabIndex = 7;
+            // PNMain
+            // 
+            this.PNMain.Controls.Add(this.PNContainer);
+            this.PNMain.Controls.Add(this.PNIcon);
+            this.PNMain.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.PNMain.Location = new System.Drawing.Point(0, 0);
+            this.PNMain.Name = "PNMain";
+            this.PNMain.Padding = new System.Windows.Forms.Padding(3);
+            this.PNMain.Size = new System.Drawing.Size(360, 90);
+            this.PNMain.TabIndex = 8;
+            // 
+            // PNContainer
+            // 
+            this.PNContainer.Controls.Add(this.PNText);
+            this.PNContainer.Controls.Add(this.PNTitle);
+            this.PNContainer.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.PNContainer.Location = new System.Drawing.Point(63, 3);
+            this.PNContainer.Name = "PNContainer";
+            this.PNContainer.Size = new System.Drawing.Size(294, 84);
+            this.PNContainer.TabIndex = 10;
+            // 
+            // PNText
+            // 
+            this.PNText.Controls.Add(this.LBText);
+            this.PNText.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.PNText.Location = new System.Drawing.Point(0, 26);
+            this.PNText.Name = "PNText";
+            this.PNText.Padding = new System.Windows.Forms.Padding(3);
+            this.PNText.Size = new System.Drawing.Size(294, 58);
+            this.PNText.TabIndex = 10;
+            // 
+            // PNTitle
+            // 
+            this.PNTitle.Controls.Add(this.LBTitle);
+            this.PNTitle.Dock = System.Windows.Forms.DockStyle.Top;
+            this.PNTitle.Location = new System.Drawing.Point(0, 0);
+            this.PNTitle.Name = "PNTitle";
+            this.PNTitle.Padding = new System.Windows.Forms.Padding(3);
+            this.PNTitle.Size = new System.Drawing.Size(294, 26);
+            this.PNTitle.TabIndex = 9;
+            // 
+            // PNIcon
+            // 
+            this.PNIcon.Controls.Add(this.PBIcon);
+            this.PNIcon.Dock = System.Windows.Forms.DockStyle.Left;
+            this.PNIcon.Location = new System.Drawing.Point(3, 3);
+            this.PNIcon.Name = "PNIcon";
+            this.PNIcon.Size = new System.Drawing.Size(60, 84);
+            this.PNIcon.TabIndex = 9;
             // 
             // ToastForm
             // 
@@ -105,8 +155,8 @@
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(31)))), ((int)(((byte)(31)))));
             this.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(72)))), ((int)(((byte)(72)))), ((int)(((byte)(72)))));
-            this.ClientSize = new System.Drawing.Size(360, 80);
-            this.Controls.Add(this.panel1);
+            this.ClientSize = new System.Drawing.Size(360, 90);
+            this.Controls.Add(this.PNMain);
             this.MaximizeBox = false;
             this.MinimizeBox = false;
             this.Name = "ToastForm";
@@ -117,8 +167,11 @@
             this.TopMost = true;
             this.Load += new System.EventHandler(this.ToastForm_Load);
             ((System.ComponentModel.ISupportInitialize)(this.PBIcon)).EndInit();
-            this.panel1.ResumeLayout(false);
-            this.panel1.PerformLayout();
+            this.PNMain.ResumeLayout(false);
+            this.PNContainer.ResumeLayout(false);
+            this.PNText.ResumeLayout(false);
+            this.PNTitle.ResumeLayout(false);
+            this.PNIcon.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
@@ -131,6 +184,10 @@
         private System.Windows.Forms.Timer TMHide;
         private System.Windows.Forms.Timer TMHideAnim;
         private System.Windows.Forms.Timer TMShowAnim;
-        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.Panel PNMain;
+        private System.Windows.Forms.Panel PNIcon;
+        private System.Windows.Forms.Panel PNContainer;
+        private System.Windows.Forms.Panel PNText;
+        private System.Windows.Forms.Panel PNTitle;
     }
 }

+ 19 - 4
Azylee.Utils/Azylee.WinformSkin/FormUI/Toast/ToastForm.cs

@@ -97,15 +97,30 @@ namespace Azylee.WinformSkin.FormUI.Toast
         /// <param name="time">显示时间:ms</param>
         private void SetContent(string title, string text, ToastType type, int time)
         {
-            TimeSpend = 0;//初始化运行时间,每次执行动画++
-            SetPosition();//设置初始位置
-            TMShowAnim.Interval = 10;//设置显示动画执行间隔
-
             Text = title;//设置程序标题
             LBTitle.Text = title;//设置显示标题
             LBText.Text = text;//设置内容
             SetType(type);//设置消息类型
             TMHide.Interval = time;//设置显示时长
+
+            Height = 80;
+            try
+            {
+                int byte_len = Encoding.UTF8.GetBytes(LBText.Text).Length;
+                if (byte_len > 105)
+                {
+                    byte_len -= 105;
+                    Height = 100;
+
+                    while ((byte_len = byte_len - 55) > 0) Height += 20;
+                } 
+            }
+            catch { }
+
+            TimeSpend = 0;//初始化运行时间,每次执行动画++
+            SetPosition();//设置初始位置
+            TMShowAnim.Interval = 10;//设置显示动画执行间隔
+            SetBorder();//重置边框(因窗口高度发生变化,刷新边框)
         }
         /// <summary>
         /// 设置消息类型

+ 6 - 0
Azylee.Utils/Tests/Test.Toast/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7" />
+    </startup>
+</configuration>

+ 135 - 0
Azylee.Utils/Tests/Test.Toast/Form1.Designer.cs

@@ -0,0 +1,135 @@
+namespace Test.Toast
+{
+    partial class Form1
+    {
+        /// <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 Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            this.button1 = new System.Windows.Forms.Button();
+            this.button2 = new System.Windows.Forms.Button();
+            this.button3 = new System.Windows.Forms.Button();
+            this.button4 = new System.Windows.Forms.Button();
+            this.button5 = new System.Windows.Forms.Button();
+            this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
+            this.button6 = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(12, 12);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(75, 23);
+            this.button1.TabIndex = 0;
+            this.button1.Text = "button1";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // button2
+            // 
+            this.button2.Location = new System.Drawing.Point(197, 12);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(75, 23);
+            this.button2.TabIndex = 1;
+            this.button2.Text = "button2";
+            this.button2.UseVisualStyleBackColor = true;
+            this.button2.Click += new System.EventHandler(this.button2_Click);
+            // 
+            // button3
+            // 
+            this.button3.Location = new System.Drawing.Point(197, 41);
+            this.button3.Name = "button3";
+            this.button3.Size = new System.Drawing.Size(75, 23);
+            this.button3.TabIndex = 2;
+            this.button3.Text = "button3";
+            this.button3.UseVisualStyleBackColor = true;
+            this.button3.Click += new System.EventHandler(this.button3_Click);
+            // 
+            // button4
+            // 
+            this.button4.Location = new System.Drawing.Point(197, 70);
+            this.button4.Name = "button4";
+            this.button4.Size = new System.Drawing.Size(75, 23);
+            this.button4.TabIndex = 3;
+            this.button4.Text = "button4";
+            this.button4.UseVisualStyleBackColor = true;
+            this.button4.Click += new System.EventHandler(this.button4_Click);
+            // 
+            // button5
+            // 
+            this.button5.Location = new System.Drawing.Point(12, 226);
+            this.button5.Name = "button5";
+            this.button5.Size = new System.Drawing.Size(75, 23);
+            this.button5.TabIndex = 4;
+            this.button5.Text = "button5";
+            this.button5.UseVisualStyleBackColor = true;
+            this.button5.Click += new System.EventHandler(this.button5_Click);
+            // 
+            // notifyIcon1
+            // 
+            this.notifyIcon1.Text = "notifyIcon1";
+            this.notifyIcon1.Visible = true;
+            // 
+            // button6
+            // 
+            this.button6.Location = new System.Drawing.Point(28, 85);
+            this.button6.Name = "button6";
+            this.button6.Size = new System.Drawing.Size(75, 23);
+            this.button6.TabIndex = 5;
+            this.button6.Text = "button6";
+            this.button6.UseVisualStyleBackColor = true;
+            this.button6.Click += new System.EventHandler(this.button6_Click);
+            // 
+            // Form1
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(284, 261);
+            this.Controls.Add(this.button6);
+            this.Controls.Add(this.button5);
+            this.Controls.Add(this.button4);
+            this.Controls.Add(this.button3);
+            this.Controls.Add(this.button2);
+            this.Controls.Add(this.button1);
+            this.Name = "Form1";
+            this.Text = "Form1";
+            this.Load += new System.EventHandler(this.Form1_Load);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.Button button2;
+        private System.Windows.Forms.Button button3;
+        private System.Windows.Forms.Button button4;
+        private System.Windows.Forms.Button button5;
+        private System.Windows.Forms.NotifyIcon notifyIcon1;
+        private System.Windows.Forms.Button button6;
+    }
+}
+

+ 65 - 0
Azylee.Utils/Tests/Test.Toast/Form1.cs

@@ -0,0 +1,65 @@
+using Azylee.WinformSkin.FormUI.Toast;
+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;
+using static Azylee.WinformSkin.FormUI.Toast.ToastForm;
+
+namespace Test.Toast
+{
+    public partial class Form1 : Form
+    {
+        public Form1()
+        {
+            InitializeComponent();
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            ToastForm.Display("中车四方终端准入系统提示", "系统自动检测发现故障,由于准入系统认证组件工作异常,导致无法正常访问网络,需要进行尝试修复,请点击此提示系统自动修复,修复成功后请尝试登录。", ToastType.info, null, 10);
+        }
+
+        private void button2_Click(object sender, EventArgs e)
+        {
+            ToastForm.Display("中车四方终端准入系统提示", "一二三四五六七八九十一二三四五六七八", ToastType.info, null, 10);
+
+        }
+
+        private void button3_Click(object sender, EventArgs e)
+        {
+            ToastForm.Display("中车四方终端准入系统提示", "一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五", ToastType.info, null, 10);
+        }
+
+        private void button4_Click(object sender, EventArgs e)
+        {
+            ToastForm.Display("中车四方终端准入系统提示", "一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六", ToastType.info, null, 10);
+        }
+
+        string str = "六";
+        private void button5_Click(object sender, EventArgs e)
+        {
+            str = "一二三四五六七八九十";
+            str = str + str + str + str + str + str + str + str + str + str + str
+                 + str + str + str + str + str + str + str + str + str + str
+                 + str + str + str + str + str + str + str + str + str + str;
+            ToastForm.Display("中车四方终端准入系统提示", str, ToastType.info, null, 10);
+        }
+
+        private void Form1_Load(object sender, EventArgs e)
+        {
+      
+        }
+
+        private void button6_Click(object sender, EventArgs e)
+        {
+            ToolTipIcon icon = ToolTipIcon.Info;
+            icon = ToolTipIcon.Error;
+            notifyIcon1.ShowBalloonTip(5, "123wrefdasdfgf", str, icon);
+        }
+    }
+}

+ 123 - 0
Azylee.Utils/Tests/Test.Toast/Form1.resx

@@ -0,0 +1,123 @@
+<?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>
+  <metadata name="notifyIcon1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>118, 17</value>
+  </metadata>
+</root>

+ 22 - 0
Azylee.Utils/Tests/Test.Toast/Program.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace Test.Toast
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new Form1());
+        }
+    }
+}

+ 36 - 0
Azylee.Utils/Tests/Test.Toast/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("Test.Toast")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Test.Toast")]
+[assembly: AssemblyCopyright("Copyright ©  2018")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("576cfdd2-150a-4d0c-874a-730265537902")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 71 - 0
Azylee.Utils/Tests/Test.Toast/Properties/Resources.Designer.cs

@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本: 4.0.30319.42000
+//
+//     对此文件的更改可能导致不正确的行为,如果
+//     重新生成代码,则所做更改将丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Test.Toast.Properties
+{
+
+
+    /// <summary>
+    ///   强类型资源类,用于查找本地化字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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 ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Test.Toast.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;
+            }
+        }
+    }
+}

+ 117 - 0
Azylee.Utils/Tests/Test.Toast/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?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.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: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" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </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" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 30 - 0
Azylee.Utils/Tests/Test.Toast/Properties/Settings.Designer.cs

@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Test.Toast.Properties
+{
+
+
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
Azylee.Utils/Tests/Test.Toast/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 88 - 0
Azylee.Utils/Tests/Test.Toast/Test.Toast.csproj

@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{576CFDD2-150A-4D0C-874A-730265537902}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>Test.Toast</RootNamespace>
+    <AssemblyName>Test.Toast</AssemblyName>
+    <TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="Form1.resx">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Azylee.WinformSkin\Azylee.WinformSkin.csproj">
+      <Project>{d280c16f-fde2-4647-bd76-3514f673426d}</Project>
+      <Name>Azylee.WinformSkin</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>