tangxu
2025-02-10 e40718947b5aa9205c87a7478aa86c37a82e0510
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
#region Imports
 
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms.Design;
 
#endregion
 
namespace DPumpHydr.WinFrmUI.RLT.Design.Poison
{
    #region PoisonTextBoxDesignerDesign
 
    internal class PoisonTextBoxDesigner : ControlDesigner
    {
        public override SelectionRules SelectionRules
        {
            get
            {
                PropertyDescriptor propDescriptor = TypeDescriptor.GetProperties(Component)["Multiline"];
 
                if (propDescriptor != null)
                {
                    bool isMultiline = (bool)propDescriptor.GetValue(Component);
 
                    if (isMultiline)
                    {
                        return SelectionRules.Visible | SelectionRules.Moveable | SelectionRules.AllSizeable;
                    }
 
                    return SelectionRules.Visible | SelectionRules.Moveable | SelectionRules.LeftSizeable | SelectionRules.RightSizeable;
                }
 
                return base.SelectionRules;
            }
        }
 
        protected override void PreFilterProperties(IDictionary properties)
        {
            properties.Remove("BackgroundImage");
            properties.Remove("ImeMode");
            properties.Remove("Padding");
            properties.Remove("BackgroundImageLayout");
            properties.Remove("Font");
 
            base.PreFilterProperties(properties);
        }
    }
 
    #endregion
}