Exemplo n.º 1
0
        /// <summary>
        /// Adds a node
        /// </summary>
        /// <param name="parent">Parent node</param>
        /// <param name="text">Text to display</param>
        /// <param name="type">Type of the asset</param>
        private void AddNode(TreeNode parent, string text, Type type)
        {
            TreeNode element = parent.Nodes.Add(text);

            element.Tag = type;

            int imgindex = 14;

            if (NodeIcons.ContainsKey(type))
            {
                imgindex = NodeIcons[type];
            }

            element.ImageIndex         = imgindex;
            element.SelectedImageIndex = imgindex;
        }
Exemplo n.º 2
0
 private static void EnsureIconsLoaded()
 {
     if (!_sIconsLoaded)
     {
         lock (_lock)
         {
             if (!_sIconsLoaded)
             {
                 _sIcons = new NodeIcons(Resource.TeamExplorerIcons);
                 var image = _sIcons.IconStrip.Images[3];
                 _sIconHandle = ((Bitmap)image).GetHicon();
                 var image2 = _sIcons.IconStrip.Images[4];
                 _sOpenIconHandle = ((Bitmap)image2).GetHicon();
                 _sIconsLoaded    = true;
             }
         }
     }
 }