yangyin
2025-02-28 baa80d650adebcce70f1113cc1020c6039c159a0
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
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 System.Windows.Forms;
using DPumpHydr.WinFrmUI.WenSkin.Controls;
 
 
namespace DPumpHydr.WinFrmUI.WenSkin.Design.Designer
{
    public class WenButtonDesigner : TextDesigner
    {
        public override void AddDesignerActionList()
        {
            this.ActionLists.Add(new WenDesignerActionList(this.Component));
        }
 
        public class WenDesignerActionList : TextBoxDesignerActionList
        {
            public WenDesignerActionList(IComponent component) : base(component)
            {
            }
 
            public WenButton WenButton => this.Component as WenButton;
 
            public Image Image { get => WenButton.Image; set => WenButton.Image = value; }
 
            public WenButton.WenButtonBorderStyle BorderStyle
            { get => WenButton.BorderStyle; set => WenButton.BorderStyle = value; }
            public Size ImageSize { get => WenButton.ImageSize; set => WenButton.ImageSize = value; }
 
            public TextImageRelation TextImageRelation { get => WenButton.TextImageRelation; set => WenButton.TextImageRelation = value; }
 
            public override DesignerActionItemCollection GetSortedActionItems()
            {
                DesignerActionPropertyItem image = new DesignerActionPropertyItem("Image", "图标");
                DesignerActionPropertyItem text = new DesignerActionPropertyItem("Text", "文本");
 
                DesignerActionPropertyItem borderStyle = new DesignerActionPropertyItem("BorderStyle", "边框样式");
                DesignerActionPropertyItem imageSize = new DesignerActionPropertyItem("ImageSize", "图标尺寸");
                DesignerActionPropertyItem textImageRelation = new DesignerActionPropertyItem("TextImageRelation", "图表文字位置");
 
 
                return new DesignerActionItemCollection() { image, text, borderStyle, imageSize, textImageRelation };
            }
        }
    }
}