コード例 #1
0
        // Hijack the rendering of each content node to customize the icon shown.
        void TreeControllerBase_TreeNodesRendering(TreeControllerBase sender, TreeNodesRenderingEventArgs e)
        {
            if (sender.TreeAlias == Constants.Trees.Content)
            {
                var customIcons = _contentNodeIconsService.GetIcons();

                foreach (TreeNode treeNode in e.Nodes)
                {
                    int nodeId = Convert.ToInt32(treeNode.Id);
                    if (nodeId <= 0)
                    {
                        continue;
                    }

                    var node = customIcons.Where(x => x.ContentId.Equals(nodeId)).FirstOrDefault();
                    if (node == null)
                    {
                        continue;
                    }

                    treeNode.Icon = $"{node.Icon} {node.IconColor}";
                }
            }
        }
コード例 #2
0
 public List <Schema> GetIcons()
 {
     return(_contentNodeIconsService.GetIcons());
 }