schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using SqlSugar;
using System.Windows;
 
namespace XImagingXhandler.XDAL
{
    /// <summary>
    /// 元素类
    /// </summary>
    public class Element
    {
        #region Fields
        private bool isDragging = false;//是否正在拖动
        private bool isStretching = false;//是否拉伸
        private bool stretchLeft = false;//是向左拉伸
        private bool stretchRight = false;//是向右拉伸
        private IInputElement inputElement = null;//输入元素对象
        private double x, y = 0;//变量
        private int zIndex = 0;//zIndex变量
        #endregion
 
        #region Constructor
        public Element() { }
        #endregion
 
        #region Properties
        public IInputElement InputElement
        {
            get { return this.inputElement; }
            set
            {
                this.inputElement = value;
                this.isDragging = false;
                this.isStretching = false;
            }
        }
        /// <summary>
        /// x方向值
        /// </summary>
        public double X
        {
            get { return this.x; }
            set { this.x = value; }
        }
        /// <summary>
        /// y方向值
        /// </summary>
        public double Y
        {
            get { return this.y; }
            set { this.y = value; }
        }
        /// <summary>
        /// Z方向值
        /// </summary>
        public int ZIndex
        {
            get { return this.zIndex; }
            set { this.zIndex = value; }
        }
        /// <summary>
        /// 是否正在拖动
        /// </summary>
        public bool IsDragging
        {
            get { return this.isDragging; }
            set
            {
                this.isDragging = value;
                this.isStretching = !this.isDragging;
            }
        }
        /// <summary>
        /// 是否拉伸
        /// </summary>
        public bool IsStretching
        {
            get { return this.isStretching; }
            set
            {
                this.isStretching = value;
                this.IsDragging = !this.isStretching;
            }
        }
        /// <summary>
        /// 是向左拉伸
        /// </summary>
        public bool StretchLeft
        {
            get { return this.stretchLeft; }
            set { this.stretchLeft = value; this.stretchRight = !this.stretchLeft; }
        }
        /// <summary>
        /// 是向右拉伸
        /// </summary>
        public bool StretchRight
        {
            get { return this.stretchRight; }
            set { this.stretchRight = value; this.stretchLeft = !this.stretchRight; }
        }
        #endregion
    }
}