From 78584911d0457ad9fc26d9dfc6f374b7ef531c0f Mon Sep 17 00:00:00 2001
From: xcd <834800634@qq.com>
Date: 星期日, 22 十一月 2020 13:45:09 +0800
Subject: [PATCH] 1. 添加操作员输入和界面显示 2. 添加通过输入窗体 3. 添加webservice调用帮助类 4. M071添加MES数据检查和数据上传功能,添加相关界面显示和流程控制

---
 src/Bro.UI.Model.Winform/UI/Canvas.cs |   67 +++++++++++++++++++--------------
 1 files changed, 39 insertions(+), 28 deletions(-)

diff --git a/src/Bro.UI.Model.Winform/UI/Canvas.cs b/src/Bro.UI.Model.Winform/UI/Canvas.cs
index feb020d..9b7102f 100644
--- a/src/Bro.UI.Model.Winform/UI/Canvas.cs
+++ b/src/Bro.UI.Model.Winform/UI/Canvas.cs
@@ -77,22 +77,26 @@
             set => stsStatus.Visible = value;
         }
 
-        private void OnMouseLocationUpdated(Point screenPoint, Point imagePoint)
+        private void OnMouseLocationUpdated(Point screenPoint, Point imagePoint, string colorDesc)
         {
-            MouseLocationUpdated(screenPoint, imagePoint);
+            //await Task.Run(() => tsslLocation.Text = $"灞忓箷鍧愭爣X锛歿screenPoint.X}锛孻锛歿screenPoint.Y}    鍥剧墖鍧愭爣X锛歿imagePoint.X}锛孻锛歿imagePoint.Y}   棰滆壊锛歿colorDesc}");
+            this.Invoke(new Action(() =>
+            {
+                tsslLocation.Text = $"灞忓箷鍧愭爣X锛歿screenPoint.X}锛孻锛歿screenPoint.Y}    鍥剧墖鍧愭爣X锛歿imagePoint.X}锛孻锛歿imagePoint.Y}   棰滆壊锛歿colorDesc}";
+            }));
         }
 
-        private void MouseLocationUpdated(Point screenPoint, Point imagePoint)
-        {
-            if (InvokeRequired)
-            {
-                Invoke(new Action<Point, Point>(MouseLocationUpdated), screenPoint, imagePoint);
-            }
-            else
-            {
-                tsslLocation.Text = $"灞忓箷鍧愭爣X锛歿screenPoint.X}锛孻锛歿screenPoint.Y}    鍥剧墖鍧愭爣X锛歿imagePoint.X}锛孻锛歿imagePoint.Y}";
-            }
-        }
+        //private void MouseLocationUpdated(Point screenPoint, Point imagePoint, string colorDesc)
+        //{
+        //    if (InvokeRequired)
+        //    {
+        //        Invoke(new Action<Point, Point, string>(MouseLocationUpdated), screenPoint, imagePoint);
+        //    }
+        //    else
+        //    {
+        //        tsslLocation.Text = $"灞忓箷鍧愭爣X锛歿screenPoint.X}锛孻锛歿screenPoint.Y}    鍥剧墖鍧愭爣X锛歿imagePoint.X}锛孻锛歿imagePoint.Y}   棰滆壊锛歿colorDesc}";
+        //    }
+        //}
         #endregion
 
         #region 灞炴��
@@ -233,7 +237,7 @@
             {
                 ele.IsEnabled = e.CheckedState;
             }
-            OnElementChanged();
+            OnElementChanged(null);
         }
 
         private void dgElements_SelectionChanged(object sender, EventArgs e)
@@ -266,7 +270,7 @@
 
         private void Elements_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
         {
-            OnElementChanged();
+            OnElementChanged(null);
 
             foreach (IShapeElement ele in Elements)
             {
@@ -277,14 +281,17 @@
 
         private void Ele_PropertyChanged(object sender, PropertyChangedEventArgs e)
         {
-            OnElementChanged();
+            OnElementChanged(sender as IShapeElement);
         }
 
-        private void OnElementChanged()
+        private void OnElementChanged(IShapeElement ele)
         {
+            if (ele != null)
+                OnElementChangedHandle?.Invoke(ele);
+
             if (InvokeRequired)
             {
-                Invoke(new Action(() => OnElementChanged()));
+                Invoke(new Action(() => OnElementChanged(ele)));
             }
             else
             {
@@ -377,17 +384,17 @@
 
         private void tsmiUnselectElements_Click(object sender, EventArgs e)
         {
-            if (MouseState == MouseState.SelectedElement)
-            {
-                MouseState = MouseState.Normal;
+            //if (MouseState == MouseState.SelectedElement)
+            //{
+            //    MouseState = MouseState.Normal;
 
-                //Elements.ForEach(ele =>
-                foreach (IShapeElement ele in Elements)
-                {
-                    ele.State = ElementState.Normal;
-                }
-                //);
-            }
+            //    //Elements.ForEach(ele =>
+            //    foreach (IShapeElement ele in Elements)
+            //    {
+            //        ele.State = ElementState.Normal;
+            //    }
+            //    //);
+            //}
         }
         #endregion
 
@@ -539,5 +546,9 @@
             }
         }
         #endregion
+
+        #region 浜嬩欢
+        public event Action<IShapeElement> OnElementChangedHandle;
+        #endregion
     }
 }

--
Gitblit v1.8.0