Ejemplo n.º 1
0
        public OptionsTreeView()
        {
            InitializeImageList();

            DrawMode   = TreeViewDrawMode.OwnerDrawText;
            ShowLines  = ShowRootLines = ShowPlusMinus = true;
            Scrollable = true;

            VsShellUtilities.ApplyTreeViewThemeStyles(this);
        }
Ejemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            foreach (var node in _optionsTree.Nodes)
            {
                OptionFolderNode folder = node as OptionFolderNode;
                if (folder != null && folder.WasExpanded)
                {
                    // this control gets closed and re-opened when the user closs
                    // the options dialog and re-opens it.  We remember which nodes
                    // were open and re-expand them so that they are unchanged.
                    folder.Expand();
                }
            }

            VsShellUtilities.ApplyTreeViewThemeStyles(_optionsTree);

            base.OnLoad(e);
        }
Ejemplo n.º 3
0
        public DatabaseObjectTreeView()
        {
            InitializeComponent();

            components = new Container();

            // Load new ImageList with glyphs from resources
            var imageList = new ImageList(components)
            {
                ColorDepth       = ColorDepth.Depth32Bit,
                ImageSize        = new Size(16, 16),
                TransparentColor = Color.Magenta
            };

            imageList.Images.Add("DbTables.bmp", Resources.DbTables);
            imageList.Images.Add("Table.bmp", Resources.Table);
            imageList.Images.Add("DbViews.bmp", Resources.DbViews);
            imageList.Images.Add("View.bmp", Resources.View);
            imageList.Images.Add("DBStoredProcs.bmp", Resources.DBStoredProcs);
            imageList.Images.Add("StoredProc.bmp", Resources.StoredProc);
            imageList.Images.Add("DbDeletedItems.bmp", Resources.DbDeletedItems);
            imageList.Images.Add("DeletedItem.bmp", Resources.DeletedItem);
            imageList.Images.Add("DbAddedItems.bmp", Resources.DbAddedItems);
            imageList.Images.Add("DbUpdatedItems.bmp", Resources.DbUpdatedItems);
            imageList.Images.Add("database_schema.bmp", Resources.database_schema);

#pragma warning disable 0618 // DpiHelper is obsolete, need to move to DpiAwareness (and ImageManifest)
            // scale images as appropriate for screen resolution
            DpiHelper.LogicalToDeviceUnits(ref imageList);
#pragma warning restore 0618

            treeView.ImageList = imageList;

            VsShellUtilities.ApplyTreeViewThemeStyles(treeView);
            treeView.DrawMode    = TreeViewDrawMode.OwnerDrawText;
            treeView.DrawNode   += TreeViewControl_DrawNode;
            treeView.AfterCheck += TreeViewControl_AfterCheck;
        }