Пример #1
0
        private void UpdateSecurityAttributes(TabPage tab_page, TreeView treeView, SecurityAttributeType type)
        {
            var attrs = _token.GetSecurityAttributes(type, false);

            if (!attrs.IsSuccess || attrs.Result.Length == 0)
            {
                tabControlSecurityAttributes.TabPages.Remove(tab_page);
            }
            treeView.Nodes.Clear();
            foreach (ClaimSecurityAttribute attr in attrs.Result)
            {
                TreeNode node = new TreeNode(attr.Name);
                node.Nodes.Add($"Flags: {attr.Flags}");
                node.Nodes.Add($"Type: {attr.ValueType}");
                int value_index = 0;
                foreach (object value in attr.Values)
                {
                    node.Nodes.Add($"Value {value_index++}: {FormatAttributeValue(value)}");
                }
                treeView.Nodes.Add(node);
            }
            foreach (TreeNode node in treeView.Nodes)
            {
                node.Expand();
            }
        }