コード例 #1
0
        private void AddLink(ResourceNode resourceNode, IResourceProperty property, TreeNode parentNode)
        {
            int    iconIndex       = Core.ResourceIconManager.GetPropTypeIconIndex(property.PropId);
            string linkDisplayName = _resourceStore.PropTypes.GetPropDisplayName(property.PropId);

            Tracer._Trace("LINKNAME = " + linkDisplayName + " LINKID = " + property.PropId.ToString());

            TreeNode treeSubNode =
                new TreeNode(linkDisplayName, iconIndex, iconIndex);
            LinkNode linkNode = resourceNode.AddLink(linkDisplayName, property.Name, property.PropId < 0);

            treeSubNode.Tag = new SerializableTag(linkNode, SerializableTag.Type.Link);
            parentNode.Nodes.Add(treeSubNode);
            _resourceTreeView.SetNodeCheckState(treeSubNode, NodeCheckState.Checked);
            if (AddLinkedResources(treeSubNode, resourceNode.Resource, property.PropId, linkNode) == 0)
            {
                parentNode.Nodes.Remove(treeSubNode);
            }
        }