Dim trv1 As WinForm.TreeView = e.Form.Controls("用户列表")
For Each u As UserInfo In Users
If u.Type = UserTypeEnum.User Then '排除管理员和开发者
If trv1.Nodes.Contains(u.Group) = False Then
trv1.Nodes.Add(u.Group)
End If
trv1.Nodes(u.Group).Nodes.Add(u.Name)
End If
Next
Dim tv As WinForm.TreeView = e.Form.Controls("菜单权限")
tv.Nodes.Clear
tv.Nodes.Add("功能区")
For Each rtb As RibbonMenu.Tab In RibbonTabs
If tv.Nodes("功能区").Nodes.Contains(rtb.Name) = False
tv.Nodes("功能区").Nodes.Add(rtb.Name)
End If
For Each grp As RibbonMenu.Group In rtb.Groups
If tv.Nodes("功能区").Nodes(rtb.Name).Nodes.Contains(grp.Name) = False Then
tv.Nodes("功能区").Nodes(rtb.Name).Nodes.Add(grp.Name)
End If
For Each itm As RibbonMenu.RibbonItem In grp.Items
If tv.Nodes("功能区").Nodes(rtb.Name).Nodes(grp.Name).Nodes.Contains(itm.Name) = False Then
tv.Nodes("功能区").Nodes(rtb.Name).Nodes(grp.Name).Nodes.Add(itm.Name)
End If
Next
Next
Next
'快速访问兰
Dim tv9 As WinForm.TreeView = e.Form.Controls("菜单权限")
tv9.Nodes.Add("快速访问栏")
For Each itm9 As object In QAT.Items
Dim nd9 As object = tv9.Nodes("快速访问栏").Nodes.Add(itm9.Name)
If itm9.Gettype.name <> "Button" Then
If itm9.Gettype.name <> "Separator" Then
For Each citm As object In itm9.items
Dim cnd As object = nd9.Nodes.Add(citm.Name)
If citm.Gettype.name <> "Button" Then
If citm.Gettype.name <> "Separator" Then
For Each ccitm As RibbonMenu.RibbonItem In citm.items
Dim ccnd As object = cnd.Nodes.Add(ccitm.Name)
Next
End If
End If
Next
End If
End If
Next
'配置兰
tv9.Nodes.Add("配置栏")
For Each itm9 As object In ConfigBar.Items
Dim nd9 As object = tv9.Nodes("配置栏").Nodes.Add(itm9.Name)
If itm9.Gettype.name <> "Button" Then
If itm9.Gettype.name <> "Separator" Then
For Each citm As object In itm9.items
Dim cnd As object = nd9.Nodes.Add(citm.Name)
If citm.Gettype.name <> "Button" Then
If citm.Gettype.name <> "Separator" Then
For Each ccitm As RibbonMenu.RibbonItem In citm.items
Dim ccnd As object = cnd.Nodes.Add(ccitm.Name)
Next
End If
End If
Next
End If
End If
Next
'Dim trv8 As WinForm.TreeView = e.Form.Controls("菜单权限")
For Each nd8 As WinForm.TreeNode In tv.AllNodes
If nd8.Text.IndexOf("分割条") >= 0 Then
nd8.Delete()
End If
Next
e.Form.Controls("菜单权限").Enabled = False
e.Form.Controls("Btn菜单授权保存").Enabled = False
e.Form.Controls("Btn菜单授权清除").Enabled = False
e.Form.Controls("Btn菜单授权编辑").Enabled = False
e.Form.Controls("提示1").Text = "请选择用户!!!"