tangxu
2024-10-22 4d9fe5ed98ceb6b8fe9dc52ebfb80860ad1aee99
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Drawing.Design;
using System.Linq;
using System.Text;
using static DPumpHydr.WinFrmUI.WenSkin.Controls.WenListBoxControl;
 
namespace DPumpHydr.WinFrmUI.WenSkin.Design.Designer
{
    public class WenListBoxControlDesigner : TextDesigner
    {
        public override void AddDesignerActionList()
        {
            this.ActionLists.Add(new WenDesignerActionList(this.Component));
        }
 
        public class WenDesignerActionList : TextBoxDesignerActionList
        {
            public WenDesignerActionList(IComponent component) : base(component)
            {
            }
 
            [Editor(typeof(Design.Editor.WenCollectionEditor), typeof(UITypeEditor))]
            public WenListBoxControlItemCollection Items
            {
                get => TypeDescriptor.GetProperties(this.Component)["Items"].GetValue(this.Component) as WenListBoxControlItemCollection;
                set => TypeDescriptor.GetProperties(this.Component)["Items"].SetValue(this.Component, value);
            }
            public string ColumnName
            {
                get => TypeDescriptor.GetProperties(this.Component)["ColumnName"].GetValue(this.Component)?.ToString();
                set => TypeDescriptor.GetProperties(this.Component)["ColumnName"].SetValue(this.Component, value);
            }
            public int ItemHight
            {
                get => (int)TypeDescriptor.GetProperties(this.Component)["ItemHight"].GetValue(this.Component);
                set => TypeDescriptor.GetProperties(this.Component)["ItemHight"].SetValue(this.Component, value);
            }
            public bool AutoItemHight
            {
                get => (bool)TypeDescriptor.GetProperties(this.Component)["AutoItemHight"].GetValue(this.Component);
                set => TypeDescriptor.GetProperties(this.Component)["AutoItemHight"].SetValue(this.Component, value);
            }
            public Image ButtonImage
            {
                get => (Image)TypeDescriptor.GetProperties(this.Component)["ButtonImage"].GetValue(this.Component);
                set => TypeDescriptor.GetProperties(this.Component)["ButtonImage"].SetValue(this.Component, value);
            }
            public bool RemoveButtonShow
            {
                get => (bool)TypeDescriptor.GetProperties(this.Component)["RemoveButtonShow"].GetValue(this.Component);
                set => TypeDescriptor.GetProperties(this.Component)["RemoveButtonShow"].SetValue(this.Component, value);
            }
            public bool ButtonShow
            {
                get => (bool)TypeDescriptor.GetProperties(this.Component)["ButtonShow"].GetValue(this.Component);
                set => TypeDescriptor.GetProperties(this.Component)["ButtonShow"].SetValue(this.Component, value);
            }
            public override DesignerActionItemCollection GetSortedActionItems()
            {
                DesignerActionPropertyItem text = new DesignerActionPropertyItem("Text", "文本");
                DesignerActionPropertyItem item = new DesignerActionPropertyItem("Items", "集合编辑");
                DesignerActionPropertyItem columnName = new DesignerActionPropertyItem("ColumnName", "默认数据绑定列");
                DesignerActionPropertyItem itemHight = new DesignerActionPropertyItem("ItemHight", "单项高度");
                DesignerActionPropertyItem autoItemHight = new DesignerActionPropertyItem("AutoItemHight", "是否自动尺寸");
                DesignerActionPropertyItem buttonImage = new DesignerActionPropertyItem("ButtonImage", "自定义图标");
                DesignerActionPropertyItem buttonShow = new DesignerActionPropertyItem("ButtonShow", "是否显示自定义按钮");
                DesignerActionPropertyItem removeButtonShow = new DesignerActionPropertyItem("RemoveButtonShow", "是否显示删除按钮");
 
                return new DesignerActionItemCollection() { item, columnName, itemHight, autoItemHight, buttonImage, buttonShow, removeButtonShow };
            }
        }
    }
}