From 47357b88db0bb5fc6bffe7932909cbdbdaff1ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8-=E6=98=93-=E6=9D=A8?= <64038497@qq.com> Date: Sat, 2 Jan 2021 14:45:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0CanSelectRootNode=20?= =?UTF-8?q?=E4=B8=8E=20CheckBoxes=20=E4=BA=92=E6=96=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/UIComboTreeView.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/SunnyUI/Controls/UIComboTreeView.cs b/SunnyUI/Controls/UIComboTreeView.cs index 89e7637a..9b14830d 100644 --- a/SunnyUI/Controls/UIComboTreeView.cs +++ b/SunnyUI/Controls/UIComboTreeView.cs @@ -46,15 +46,25 @@ namespace Sunny.UI [Description("显示节点集合"), Category("SunnyUI")] public TreeNodeCollection Nodes => item.TreeView.Nodes; - [DefaultValue(false), Description("是否显示单选框"), Category("SunnyUI")] + [DefaultValue(false), Description("是否显示单选框,该属性与CanSelectRootNode互斥"), Category("SunnyUI")] public bool CheckBoxes { get => item.CheckBoxes; - set => item.CheckBoxes = value; + set { item.CheckBoxes = value; + if (value) + CanSelectRootNode = false; + } } - [DefaultValue(false), Description("单选时是否可选择父节点"), Category("SunnyUI")] - public bool CanSelectRootNode { get; set; } + [DefaultValue(false), Description("单选时是否可选择父节点,该属性与CheckBoxes互斥"), Category("SunnyUI")] + public bool CanSelectRootNode { + get =>item.CanSelectRootNode; + set { + item.CanSelectRootNode = value; + if (value) + CheckBoxes = false; + } + } [DefaultValue(false), Description("是否显示连线"), Category("SunnyUI")] public bool ShowLines From b2ad9630854f32275430431f62f275dbb3c461cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8-=E6=98=93-=E6=9D=A8?= <64038497@qq.com> Date: Sat, 2 Jan 2021 14:48:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?UIComboTreeView=EF=BC=9A=E6=B7=BB=E5=8A=A0C?= =?UTF-8?q?anSelectRootNode=20=E4=B8=8E=20CheckBoxes=20=E4=BA=92=E6=96=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/UIComboTreeView.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SunnyUI/Controls/UIComboTreeView.cs b/SunnyUI/Controls/UIComboTreeView.cs index 9b14830d..b202133f 100644 --- a/SunnyUI/Controls/UIComboTreeView.cs +++ b/SunnyUI/Controls/UIComboTreeView.cs @@ -52,7 +52,9 @@ namespace Sunny.UI get => item.CheckBoxes; set { item.CheckBoxes = value; if (value) + { CanSelectRootNode = false; + } } } @@ -62,7 +64,9 @@ namespace Sunny.UI set { item.CanSelectRootNode = value; if (value) + { CheckBoxes = false; + } } }