Browse Source

添加时钟控件

yuzhengyang 7 years ago
parent
commit
ccfdd7ccfa
21 changed files with 739 additions and 20 deletions
  1. BIN
      Fork.Net/.vs/Fork.Net/v15/Server/sqlite3/storage.ide
  2. BIN
      Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide
  3. 18 0
      Fork.Net/Azylee.Utils/Azylee.Core/DataUtils/DateTimeUtils/DateTool.cs
  4. 21 0
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/Azylee.WinformSkin.csproj
  5. 47 0
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/ButtonUI/ImageButton.Designer.cs
  6. 99 0
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/ButtonUI/ImageButton.cs
  7. 120 0
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/ButtonUI/ImageButton.resx
  8. 23 5
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/FormUI/CustomTitle/BigIconForm.cs
  9. 6 6
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/FormUI/NoTitle/NoTitleForm.cs
  10. 17 4
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/FormUI/Toast/ToastForm.Designer.cs
  11. 30 0
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/Properties/Resources.Designer.cs
  12. 12 3
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/Properties/Resources.resx
  13. BIN
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/UserWidgets/ClockWidgets/Images/simpleclock_simple.psd
  14. BIN
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/UserWidgets/ClockWidgets/Images/simpleclock_simple_hour_hand_1.png
  15. BIN
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/UserWidgets/ClockWidgets/Images/simpleclock_simple_minute_hand_1.png
  16. BIN
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/UserWidgets/ClockWidgets/Images/simpleclock_simple_second_hand_1.png
  17. 55 0
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/UserWidgets/ClockWidgets/SimpleClockControl.Designer.cs
  18. 153 0
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/UserWidgets/ClockWidgets/SimpleClockControl.cs
  19. 123 0
      Fork.Net/Azylee.Utils/Azylee.WinformSkin/UserWidgets/ClockWidgets/SimpleClockControl.resx
  20. 14 0
      Fork.Net/Test/Y.Test/Views/MainForm.Designer.cs
  21. 1 2
      Fork.Net/Test/Y.Test/Views/MainForm.cs

BIN
Fork.Net/.vs/Fork.Net/v15/Server/sqlite3/storage.ide


BIN
Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide


+ 18 - 0
Fork.Net/Azylee.Utils/Azylee.Core/DataUtils/DateTimeUtils/DateTool.cs

@@ -28,5 +28,23 @@ namespace Azylee.Core.DataUtils.DateTimeUtils
                 return true;
             return false;
         }
+        /// <summary>
+        /// 当月有多少天
+        /// </summary>
+        /// <param name="year"></param>
+        /// <param name="month"></param>
+        /// <returns></returns>
+        public static int MonthDays(int year, int month)
+        {
+            int days = 1;
+            try
+            {
+                DateTime begin = new DateTime(year, month, 1);
+                DateTime end = begin.AddMonths(1);
+                days = (int)(end - begin).TotalDays;
+            }
+            catch { }
+            return days;
+        }
     }
 }

+ 21 - 0
Fork.Net/Azylee.Utils/Azylee.WinformSkin/Azylee.WinformSkin.csproj

@@ -43,6 +43,12 @@
   <ItemGroup>
     <Compile Include="APIUtils\FormAnimateAPI.cs" />
     <Compile Include="APIUtils\FormStyleAPI.cs" />
+    <Compile Include="ButtonUI\ImageButton.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="ButtonUI\ImageButton.Designer.cs">
+      <DependentUpon>ImageButton.cs</DependentUpon>
+    </Compile>
     <Compile Include="FormUI\CustomTitle\BigIconForm.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -86,6 +92,12 @@
       <DependentUpon>Resources.resx</DependentUpon>
     </Compile>
     <Compile Include="StyleUtils\ColorStyle.cs" />
+    <Compile Include="UserWidgets\ClockWidgets\SimpleClockControl.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="UserWidgets\ClockWidgets\SimpleClockControl.Designer.cs">
+      <DependentUpon>SimpleClockControl.cs</DependentUpon>
+    </Compile>
     <Compile Include="UserWidgets\PageWidgets\PageDataProviderArgs.cs" />
     <Compile Include="UserWidgets\PageWidgets\PageToolBar.cs">
       <SubType>UserControl</SubType>
@@ -102,6 +114,9 @@
   </ItemGroup>
   <ItemGroup />
   <ItemGroup>
+    <EmbeddedResource Include="ButtonUI\ImageButton.resx">
+      <DependentUpon>ImageButton.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FormUI\CustomTitle\BigIconForm.resx">
       <DependentUpon>BigIconForm.cs</DependentUpon>
     </EmbeddedResource>
@@ -124,6 +139,9 @@
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
+    <EmbeddedResource Include="UserWidgets\ClockWidgets\SimpleClockControl.resx">
+      <DependentUpon>SimpleClockControl.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="UserWidgets\PageWidgets\PageToolBar.resx">
       <DependentUpon>PageToolBar.cs</DependentUpon>
     </EmbeddedResource>
@@ -135,6 +153,9 @@
     <Content Include="FormUI\Toast\Images\toast_error.png" />
     <Content Include="FormUI\Toast\Images\toast_info.png" />
     <Content Include="FormUI\Toast\Images\toast_warning.png" />
+    <Content Include="UserWidgets\ClockWidgets\Images\simpleclock_simple_hour_hand_1.png" />
+    <Content Include="UserWidgets\ClockWidgets\Images\simpleclock_simple_minute_hand_1.png" />
+    <Content Include="UserWidgets\ClockWidgets\Images\simpleclock_simple_second_hand_1.png" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 47 - 0
Fork.Net/Azylee.Utils/Azylee.WinformSkin/ButtonUI/ImageButton.Designer.cs

@@ -0,0 +1,47 @@
+namespace Azylee.WinformSkin.ButtonUI
+{
+    partial class ImageButton
+    {
+        /// <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()
+        {
+            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // ImageButton
+            // 
+            this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ImageButton_MouseDown);
+            this.MouseEnter += new System.EventHandler(this.ImageButton_MouseEnter);
+            this.MouseLeave += new System.EventHandler(this.ImageButton_MouseLeave);
+            this.MouseHover += new System.EventHandler(this.ImageButton_MouseHover);
+            this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ImageButton_MouseUp);
+            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
+            this.ResumeLayout(false);
+        }
+
+        #endregion
+    }
+}

+ 99 - 0
Fork.Net/Azylee.Utils/Azylee.WinformSkin/ButtonUI/ImageButton.cs

@@ -0,0 +1,99 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace Azylee.WinformSkin.ButtonUI
+{
+    public partial class ImageButton : PictureBox
+    {
+        #region 属性
+        private Image _MouseHoverImage = null;
+        [Category("状态切换")]
+        [Description("鼠标悬停时的图片")]
+        [DefaultValue(typeof(bool), "true")]
+        public Image MouseHoverImage
+        {
+            get { return _MouseHoverImage; }
+            set { _MouseHoverImage = value; }
+        }
+        private Image _MouseDownImage = null;
+        [Category("状态切换")]
+        [Description("鼠标按下时的图片")]
+        [DefaultValue(typeof(bool), "true")]
+        public Image MouseDownImage
+        {
+            get { return _MouseDownImage; }
+            set { _MouseDownImage = value; }
+        }
+        private Image _DefaultImage = null;
+        [Category("状态切换")]
+        [Description("鼠标按下时的图片")]
+        [DefaultValue(typeof(bool), "true")]
+        public Image DefaultImage
+        {
+            get { return _DefaultImage; }
+            set
+            {
+                SizeMode = PictureBoxSizeMode.StretchImage;
+                _DefaultImage = value;
+                Image = _DefaultImage;
+            }
+        }
+        #endregion
+        public ImageButton()
+        {
+            InitializeComponent();
+        }
+        void Hover()
+        {
+            if (MouseHoverImage != null)
+            {
+                Image = MouseHoverImage;
+            }
+            else
+            {
+                Image = DefaultImage;
+            }
+        }
+        void Down()
+        {
+            if (MouseDownImage != null)
+                Image = MouseDownImage;
+        }
+        void Default()
+        {
+            Image = DefaultImage;
+        }
+
+        private void ImageButton_MouseDown(object sender, MouseEventArgs e)
+        {
+            Down();
+        }
+
+        private void ImageButton_MouseEnter(object sender, EventArgs e)
+        {
+            Hover();
+        }
+
+        private void ImageButton_MouseHover(object sender, EventArgs e)
+        {
+            Hover();
+        }
+
+        private void ImageButton_MouseLeave(object sender, EventArgs e)
+        {
+            Default();
+        }
+
+        private void ImageButton_MouseUp(object sender, MouseEventArgs e)
+        {
+            Hover();
+        }
+
+    }
+}

+ 120 - 0
Fork.Net/Azylee.Utils/Azylee.WinformSkin/ButtonUI/ImageButton.resx

@@ -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>

+ 23 - 5
Fork.Net/Azylee.Utils/Azylee.WinformSkin/FormUI/CustomTitle/BigIconForm.cs

@@ -39,6 +39,21 @@ namespace Azylee.WinformSkin.FormUI.CustomTitle
                 }
             }
         }
+        private bool _DoubleClickMax = true;
+        [Category("Style")]
+        [Description("双击最大化窗口")]
+        [DefaultValue(typeof(bool), "true")]
+        public bool DoubleClickMax
+        {
+            get { return _DoubleClickMax; }
+            set
+            {
+                if (_DoubleClickMax != value)
+                {
+                    _DoubleClickMax = value;
+                }
+            }
+        }
         #endregion
         #region UI界面调整方法
         public void UIMax()
@@ -103,13 +118,16 @@ namespace Azylee.WinformSkin.FormUI.CustomTitle
         }
         private void BigIconFormLBHeadTitle_DoubleClick(object sender, EventArgs e)
         {
-            if (WindowState != FormWindowState.Maximized)
+            if (_DoubleClickMax)
             {
-                MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
-                WindowState = FormWindowState.Maximized;
+                if (WindowState != FormWindowState.Maximized)
+                {
+                    MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
+                    WindowState = FormWindowState.Maximized;
+                }
+                else
+                    WindowState = FormWindowState.Normal;
             }
-            else
-                WindowState = FormWindowState.Normal;
         }
         /// <summary>
         /// 关闭

+ 6 - 6
Fork.Net/Azylee.Utils/Azylee.WinformSkin/FormUI/NoTitle/NoTitleForm.cs

@@ -158,12 +158,12 @@ namespace Azylee.WinformSkin.FormUI.NoTitle
                 return cp;
             }
         }
-        protected override void OnPaint(PaintEventArgs e)
-        {
-            base.OnPaint(e);
-            //Graphics g = CreateGraphics();
-            //g.DrawRectangle(new Pen(Color.Red, 1), new Rectangle(0, 0, Width, Height));
-        }
+        //protected override void OnPaint(PaintEventArgs e)
+        //{
+        //    base.OnPaint(e);
+        //    //Graphics g = CreateGraphics();
+        //    //g.DrawRectangle(new Pen(Color.Red, 1), new Rectangle(0, 0, Width, Height));
+        //}
         #endregion
         #region Invoke UI操作
         /// <summary>

+ 17 - 4
Fork.Net/Azylee.Utils/Azylee.WinformSkin/FormUI/Toast/ToastForm.Designer.cs

@@ -35,7 +35,9 @@
             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();
             ((System.ComponentModel.ISupportInitialize)(this.PBIcon)).BeginInit();
+            this.panel1.SuspendLayout();
             this.SuspendLayout();
             // 
             // PBIcon
@@ -86,6 +88,17 @@
             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;
+            // 
             // ToastForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -93,9 +106,7 @@
             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.LBText);
-            this.Controls.Add(this.LBTitle);
-            this.Controls.Add(this.PBIcon);
+            this.Controls.Add(this.panel1);
             this.MaximizeBox = false;
             this.MinimizeBox = false;
             this.Name = "ToastForm";
@@ -106,8 +117,9 @@
             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.ResumeLayout(false);
-            this.PerformLayout();
 
         }
 
@@ -119,5 +131,6 @@
         private System.Windows.Forms.Timer TMHide;
         private System.Windows.Forms.Timer TMHideAnim;
         private System.Windows.Forms.Timer TMShowAnim;
+        private System.Windows.Forms.Panel panel1;
     }
 }

+ 30 - 0
Fork.Net/Azylee.Utils/Azylee.WinformSkin/Properties/Resources.Designer.cs

@@ -63,6 +63,36 @@ namespace Azylee.WinformSkin.Properties {
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
+        internal static System.Drawing.Bitmap simpleclock_simple_hour_hand_1 {
+            get {
+                object obj = ResourceManager.GetObject("simpleclock_simple_hour_hand_1", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap simpleclock_simple_minute_hand_1 {
+            get {
+                object obj = ResourceManager.GetObject("simpleclock_simple_minute_hand_1", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap simpleclock_simple_second_hand_1 {
+            get {
+                object obj = ResourceManager.GetObject("simpleclock_simple_second_hand_1", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
         internal static System.Drawing.Bitmap toast_error {
             get {
                 object obj = ResourceManager.GetObject("toast_error", resourceCulture);

+ 12 - 3
Fork.Net/Azylee.Utils/Azylee.WinformSkin/Properties/Resources.resx

@@ -118,13 +118,22 @@
     <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="toast_error" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>..\FormUI\Toast\Images\toast_error.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
-  </data>
   <data name="toast_info" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\FormUI\Toast\Images\toast_info.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
+  <data name="toast_error" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\FormUI\Toast\Images\toast_error.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
   <data name="toast_warning" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\FormUI\Toast\Images\toast_warning.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
+  <data name="simpleclock_simple_hour_hand_1" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\UserWidgets\ClockWidgets\Images\simpleclock_simple_hour_hand_1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="simpleclock_simple_minute_hand_1" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\UserWidgets\ClockWidgets\Images\simpleclock_simple_minute_hand_1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="simpleclock_simple_second_hand_1" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\UserWidgets\ClockWidgets\Images\simpleclock_simple_second_hand_1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
 </root>

BIN
Fork.Net/Azylee.Utils/Azylee.WinformSkin/UserWidgets/ClockWidgets/Images/simpleclock_simple.psd


BIN
Fork.Net/Azylee.Utils/Azylee.WinformSkin/UserWidgets/ClockWidgets/Images/simpleclock_simple_hour_hand_1.png


BIN
Fork.Net/Azylee.Utils/Azylee.WinformSkin/UserWidgets/ClockWidgets/Images/simpleclock_simple_minute_hand_1.png


BIN
Fork.Net/Azylee.Utils/Azylee.WinformSkin/UserWidgets/ClockWidgets/Images/simpleclock_simple_second_hand_1.png


+ 55 - 0
Fork.Net/Azylee.Utils/Azylee.WinformSkin/UserWidgets/ClockWidgets/SimpleClockControl.Designer.cs

@@ -0,0 +1,55 @@
+namespace Azylee.WinformSkin.UserWidgets.ClockWidgets
+{
+    partial class SimpleClockControl
+    {
+        /// <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.components = new System.ComponentModel.Container();
+            this.TMPainter = new System.Windows.Forms.Timer(this.components);
+            this.SuspendLayout();
+            // 
+            // TMPainter
+            // 
+            this.TMPainter.Tick += new System.EventHandler(this.TMPainter_Tick);
+            // 
+            // SimpleClockControl
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.Color.GreenYellow;
+            this.DoubleBuffered = true;
+            this.Name = "SimpleClockControl";
+            this.Load += new System.EventHandler(this.SimpleClockControl_Load);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Timer TMPainter;
+    }
+}

+ 153 - 0
Fork.Net/Azylee.Utils/Azylee.WinformSkin/UserWidgets/ClockWidgets/SimpleClockControl.cs

@@ -0,0 +1,153 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using System.Drawing.Drawing2D;
+using Azylee.WinformSkin.Properties;
+
+namespace Azylee.WinformSkin.UserWidgets.ClockWidgets
+{
+    public partial class SimpleClockControl : UserControl
+    {
+        #region 属性
+        private Image _SecondHandImage = null;
+        [Category("时钟样式")]
+        [Description("秒针")]
+        public Image SecondHandImage
+        {
+            get { return _SecondHandImage; }
+            set { _SecondHandImage = value; }
+        }
+
+        private Image _MinuteHandImage = null;
+        [Category("时钟样式")]
+        [Description("分针")]
+        public Image MinuteHandImage
+        {
+            get { return _MinuteHandImage; }
+            set { _MinuteHandImage = value; }
+        }
+
+        private Image _HourHandImage = null;
+        [Category("时钟样式")]
+        [Description("时针")]
+        public Image HourHandImage
+        {
+            get { return _HourHandImage; }
+            set { _HourHandImage = value; }
+        }
+        #endregion
+        Graphics Graph = null;
+        Bitmap Bmp = null;
+        Graphics BmpGraph = null;
+        DateTime Time = DateTime.Now;
+        public SimpleClockControl()
+        {
+            InitializeComponent();
+            //采用双缓冲技术的控件必需的设置
+            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
+            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
+            SetStyle(ControlStyles.UserPaint, true);
+        }
+
+        private void SimpleClockControl_Load(object sender, EventArgs e)
+        {
+        }
+        public void Start()
+        {
+            Graph = CreateGraphics();
+            Graph.SmoothingMode = SmoothingMode.AntiAlias;
+            Bmp = new Bitmap(Width, Height);
+            BmpGraph = Graphics.FromImage(Bmp);
+            BmpGraph.SmoothingMode = SmoothingMode.AntiAlias;
+            TMPainter.Interval = 1 * 1000;
+
+            if (SecondHandImage == null)
+            {
+                TMPainter.Interval = 60 * 1000;
+                //SecondHandImage = Resources.simpleclock_simple_second_hand_1;
+            }
+            if (MinuteHandImage == null)
+            {
+                TMPainter.Interval = 60 * 60 * 1000;
+                MinuteHandImage = Resources.simpleclock_simple_minute_hand_1;
+            }
+            if (HourHandImage == null)
+            {
+                HourHandImage = Resources.simpleclock_simple_hour_hand_1;
+            }
+
+            Draw();//第一次绘制
+            TMPainter.Enabled = true;
+        }
+        public void ReDraw()
+        {
+            Draw();
+        }
+        private void TMPainter_Tick(object sender, EventArgs e)
+        {
+            Draw();
+        }
+
+        private void Draw()
+        {
+            try
+            {
+                if (Graph != null && Bmp != null && BmpGraph != null)
+                {
+                    Refresh();//强制重绘控件
+                    Time = DateTime.Now;
+                    BmpGraph.ResetTransform();//恢复默认状态
+                    BmpGraph.FillRectangle(new SolidBrush(BackColor), 0, 0, Width, Height);
+                    if (BackgroundImage != null) BmpGraph.DrawImage(BackgroundImage, 0, 0, Width, Height);
+
+                    //绘制时针
+                    if (HourHandImage != null)
+                    {
+                        BmpGraph.ResetTransform();//恢复默认状态
+                        BmpGraph.TranslateTransform(Width / 2, Height / 2);//设置原点
+                        BmpGraph.RotateTransform(Time.Hour * 30 + Time.Minute * 1 / 2);
+                        BmpGraph.DrawImage(HourHandImage, -(Width / 2), -(Height / 2), Width, Height);
+                    }
+                    //绘制分针
+                    if (MinuteHandImage != null)
+                    {
+                        BmpGraph.ResetTransform();//恢复默认状态
+                        BmpGraph.TranslateTransform(Width / 2, Height / 2);//设置原点
+                        BmpGraph.RotateTransform(Time.Minute * 6);
+                        BmpGraph.DrawImage(MinuteHandImage, -(Width / 2), -(Height / 2), Width, Height);
+                    }
+                    //绘制秒针
+                    if (SecondHandImage != null)
+                    {
+                        BmpGraph.ResetTransform();//恢复默认状态
+                        BmpGraph.TranslateTransform(Width / 2, Height / 2);//设置原点
+                        BmpGraph.RotateTransform(Time.Second * 6);//以水平线为x轴,从垂直上方开始旋转,每次旋转6度。
+                        BmpGraph.DrawImage(SecondHandImage, -(Width / 2), -(Height / 2), Width, Height);
+                    }
+                    OnPaint(new PaintEventArgs(Graph, new Rectangle(0, 0, Width, Height)));
+                }
+            }
+            catch { }
+        }
+        protected override void OnPaint(PaintEventArgs e)
+        {
+            base.OnPaint(e);
+            if (!DesignMode && e != null && e.Graphics != null && Bmp != null)
+            {
+                Graphics g = e.Graphics;
+                g.DrawImage(Bmp, 0, 0, Width, Height);
+            }
+        }
+        ~SimpleClockControl()
+        {
+            Graph.Dispose();
+            Bmp.Dispose();
+            BmpGraph.Dispose();
+        }
+    }
+}

+ 123 - 0
Fork.Net/Azylee.Utils/Azylee.WinformSkin/UserWidgets/ClockWidgets/SimpleClockControl.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="TMPainter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>

+ 14 - 0
Fork.Net/Test/Y.Test/Views/MainForm.Designer.cs

@@ -38,6 +38,7 @@
             this.BTCheckYUtils = new System.Windows.Forms.Button();
             this.TestCrossForm = new System.Windows.Forms.Button();
             this.button1 = new System.Windows.Forms.Button();
+            this.simpleClockControl1 = new Azylee.WinformSkin.UserWidgets.ClockWidgets.SimpleClockControl();
             this.SuspendLayout();
             // 
             // ChineseCalendarForm
@@ -140,11 +141,23 @@
             this.button1.UseVisualStyleBackColor = true;
             this.button1.Click += new System.EventHandler(this.button1_Click);
             // 
+            // simpleClockControl1
+            // 
+            this.simpleClockControl1.BackColor = System.Drawing.Color.GreenYellow;
+            this.simpleClockControl1.HourHandImage = null;
+            this.simpleClockControl1.Location = new System.Drawing.Point(405, 175);
+            this.simpleClockControl1.MinuteHandImage = null;
+            this.simpleClockControl1.Name = "simpleClockControl1";
+            this.simpleClockControl1.SecondHandImage = null;
+            this.simpleClockControl1.Size = new System.Drawing.Size(64, 64);
+            this.simpleClockControl1.TabIndex = 10;
+            // 
             // MainForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(564, 427);
+            this.Controls.Add(this.simpleClockControl1);
             this.Controls.Add(this.button1);
             this.Controls.Add(this.TestCrossForm);
             this.Controls.Add(this.BTCheckYUtils);
@@ -175,5 +188,6 @@
         private System.Windows.Forms.Button BTCheckYUtils;
         private System.Windows.Forms.Button TestCrossForm;
         private System.Windows.Forms.Button button1;
+        private Azylee.WinformSkin.UserWidgets.ClockWidgets.SimpleClockControl simpleClockControl1;
     }
 }

+ 1 - 2
Fork.Net/Test/Y.Test/Views/MainForm.cs

@@ -20,13 +20,12 @@ namespace Y.Test.Views
         }
         private void MainForm_Load(object sender, EventArgs e)
         {
-
+            simpleClockControl1.Start();
         }
         private void ChineseCalendarForm_Click(object sender, EventArgs e)
         {
             R.Forms.GetUnique<ChineseCalendarForm>().Show();
         }
-
         private void TestComputerInfoForm_Click(object sender, EventArgs e)
         {
             R.Forms.GetUnique<TestComputerInfoForm>().Show();