| | |
| | | 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},Y:{screenPoint.Y} 图片坐标X:{imagePoint.X},Y:{imagePoint.Y} 颜色:{colorDesc}"); |
| | | this.Invoke(new Action(() => |
| | | { |
| | | tsslLocation.Text = $"屏幕坐标X:{screenPoint.X},Y:{screenPoint.Y} 图片坐标X:{imagePoint.X},Y:{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},Y:{screenPoint.Y} 图片坐标X:{imagePoint.X},Y:{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},Y:{screenPoint.Y} 图片坐标X:{imagePoint.X},Y:{imagePoint.Y} 颜色:{colorDesc}"; |
| | | // } |
| | | //} |
| | | #endregion |
| | | |
| | | #region 属性 |
| | |
| | | { |
| | | ele.IsEnabled = e.CheckedState; |
| | | } |
| | | OnElementChanged(); |
| | | OnElementChanged(null); |
| | | } |
| | | |
| | | private void dgElements_SelectionChanged(object sender, EventArgs e) |
| | |
| | | |
| | | private void Elements_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) |
| | | { |
| | | OnElementChanged(); |
| | | OnElementChanged(null); |
| | | |
| | | foreach (IShapeElement ele in Elements) |
| | | { |
| | |
| | | |
| | | 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 |
| | | { |
| | |
| | | |
| | | 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 |
| | | |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 事件 |
| | | public event Action<IShapeElement> OnElementChangedHandle; |
| | | #endregion |
| | | } |
| | | } |