tangxu
2024-12-24 91105b77c916d06dd30380e20594e29f85eae3da
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
#region Imports
 
using DPumpHydr.WinFrmUI.RLT.Enum.Poison;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms.Design;
 
#endregion
 
namespace DPumpHydr.WinFrmUI.RLT.Design.Poison
{
    #region PoisonScrollBarDesignerDesign
 
    [Designer(typeof(ScrollableControlDesigner), typeof(ParentControlDesigner))]
    internal class PoisonScrollBarDesigner : ControlDesigner
    {
        public override SelectionRules SelectionRules
        {
            get
            {
                PropertyDescriptor propDescriptor = TypeDescriptor.GetProperties(Component)["Orientation"];
 
                if (propDescriptor != null)
                {
                    ScrollOrientationType orientation = (ScrollOrientationType)propDescriptor.GetValue(Component);
 
                    if (orientation == ScrollOrientationType.Vertical)
                    {
                        return SelectionRules.Visible | SelectionRules.Moveable | SelectionRules.BottomSizeable | SelectionRules.TopSizeable;
                    }
 
                    return SelectionRules.Visible | SelectionRules.Moveable | SelectionRules.LeftSizeable | SelectionRules.RightSizeable;
                }
 
                return base.SelectionRules;
            }
        }
 
        protected override void PreFilterProperties(IDictionary properties)
        {
            properties.Remove("Text");
            properties.Remove("BackgroundImage");
            properties.Remove("ForeColor");
            properties.Remove("ImeMode");
            properties.Remove("Padding");
            properties.Remove("BackgroundImageLayout");
            properties.Remove("BackColor");
            properties.Remove("Font");
            properties.Remove("RightToLeft");
 
            base.PreFilterProperties(properties);
        }
    }
 
    #endregion
}