コード例 #1
0
        private TreeNode GetTreeNodeFor(MsgPackItem item)
        {
            int    imgIdx = GetIconFor(item);
            string text   = ReferenceEquals(item, null) ? "NULL" : item.ToString();
            int    pos    = text.IndexOfAny(new char[] { '\r', '\n' });

            if (pos > 0)
            {
                text = text.Substring(0, pos - 1);
            }
            TreeNode node = new TreeNode(text, imgIdx, imgIdx);

            if (ReferenceEquals(item, null) || item.IsBestGuess)
            {
                node.ForeColor = Color.DarkGray;
            }
            node.Tag = item;
            return(node);
        }