cloudflight
2024-08-05 46f88867a2d3561a701535bcc6c41d0f76634b52
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static Yw.WinFrmUI.Q3D.MapViewEnum;
 
namespace Yw.WinFrmUI.Q3D
{
    public interface IBaseViewModel
    {
        [Category("基本信息")]
        [Description("对象的ID唯一标识")]
        [DisplayName(" 编号 ")]
        string ID { get; set; }
 
 
        [Category("其他参数")]
        [Description("选中")]
        [DisplayName("选中")]
        [Browsable(false)]
        bool Selected { get; set; }
        [Browsable(false)]
        bool Hovered { get; set; }
 
 
        [Category("其他参数")]
        [Description("选中")]
        [DisplayName("位置信息")]
        [Browsable(false)]
        PointF Position { get; set; }//= new PointF(0, 0);
 
        [Browsable(false)]
        [JsonIgnore]
        String regionName { get; set; }//= null; 
 
        [Category("基本信息")]
        [Description("X坐标")]
        [DisplayName("X坐标")]
        [Browsable(true)]
        float X { get; set; }
        //{
        //    get
        //    {
        //        return Position.X;
        //    }
        //    set
        //    {
        //        Position = new PointF(value, Position.Y);
        //    }
        //}
        [Category("基本信息")]
        [Description("Y坐标")]
        [DisplayName("Y坐标")]
        [Browsable(true)]
        float Y { get; set; }
        //{
        //    get
        //    {
        //        return Position.Y;
        //    }
        //    set
        //    {
        //        Position = new PointF(Position.X, value);
        //    }
        //}
 
        [Category("基本信息")]
        [Description("标高")]
        [DisplayName("标高")]
        [Browsable(true)]
        float Z { get; set; }
 
        [Category("其他参数")]
        [Description("对象的等级")]
        [DisplayName("级别")]
        //[Editor(typeof(MyPropertyEditor), typeof(UITypeEditor))]
 
        int Level { get; set; } //= 0;
        [Category("其他参数")]
        [Description("对象的等级")]
        [DisplayName("是否显示")]
        bool Visible { get; set; } //= true;
 
        //[Category("其他参数")]
        //[Description("标签集合")]
        //[DisplayName("标签")]
        //public string Tags { get; set; } = null;
 
        [Category("基本信息")]
        [Description("类型")]
        [DisplayName("类型")]
        MapObjectType Type { get; }// { get { return this.GetTypeString(); } }
 
        //[Browsable(false)]
        [Category("其他参数")]
        [Description("ID类型")]
        [DisplayName("ID类型")]
        [Browsable(false)]
        string IDType { get; }// => Type.ToString()+"\t"+ ID;
        MapObjectType GetTypeString();
 
        //TagList Tags { get; set; }
 
        //string TagsString { get; set; }
 
        bool isNode();
 
        
    }
    [Serializable]
    public class TagList:List<string>
    {
        [Category("其他参数")]
        [Browsable(false)]
        public override string  ToString()
        {
            if (Count==0) 
                return "null";
            else
                return string.Join(",", this);          
        }
 
        //public TagList(string value):base(value.Split(','))
        //{
        //    if (string.IsNullOrEmpty(value) || value == "null")
        //    {
        //        base.Clear();
        //        return;
        //    }
 
        //}
        public TagList()
        {
        }
        public TagList(string value)
        {
            if (string.IsNullOrEmpty(value) || value == "null")
            {
                base.Clear();
                return;
            }
            string[] tags = value.Split(',');
            base.AddRange(tags);
        }
    }
 
    
 
 
}