public ClassBrowserTreeView()
        {
            WorkspaceTreeNode    root     = new WorkspaceTreeNode();
            ClassBrowserTreeView instance = this;

            SD.ClassBrowser.CurrentWorkspace.AssemblyLists.CollectionChanged += delegate {
                instance.ShowRoot = SD.ClassBrowser.CurrentWorkspace.AssemblyLists.Count > 0;
            };
            root.PropertyChanged += delegate {
                instance.ShowRoot = SD.ClassBrowser.CurrentWorkspace.AssemblyLists.Count > 0;
            };
            this.Root = root;
        }
示例#2
0
        public ClassBrowserPad(IProjectService projectService)
        {
            this.projectService = projectService;
            panel               = new DockPanel();
            panel.Background    = System.Windows.Media.Brushes.Transparent;
            panel.LastChildFill = true;

            treeView = new ClassBrowserTreeView();             // treeView must be created first because it's used by CreateToolBar
            Border border = new Border();

            border.BorderBrush     = System.Windows.Media.Brushes.DarkGray;
            border.BorderThickness = new Thickness(1);
            border.CornerRadius    = new CornerRadius(2);
            border.Margin          = new Thickness(5, 0, 5, 0);
            border.Child           = treeView;

            toolBar = CreateToolBar("/SharpDevelop/Pads/ClassBrowser/Toolbar");
            toolBar.HorizontalAlignment = HorizontalAlignment.Stretch;

            ToolBarTray tray = new ToolBarTray();

            tray.Margin = new Thickness(0, 5, 0, 5);
            tray.HorizontalAlignment = HorizontalAlignment.Stretch;
            Style tbStyle = Application.Current.TryFindResource("MaterialDesignToolBar") as Style;

            if (tbStyle != null)
            {
                toolBar.Style = tbStyle;
            }

            DockPanel.SetDock(tray, Dock.Top);
            tray.ToolBars.Add(toolBar);
            panel.Children.Add(tray);
            panel.Children.Add(border);

            treeView.ContextMenu = CreateContextMenu("/SharpDevelop/Pads/UnitTestsPad/ContextMenu");
            projectService.CurrentSolutionChanged += ProjectServiceCurrentSolutionChanged;
            ProjectServiceCurrentSolutionChanged(null, null);


            // Load workspaces from configuration
            treeView.Loaded += (sender, e) => LoadWorkspaces();
        }
        public ClassBrowserPad(IProjectService projectService)
        {
            this.projectService = projectService;
            panel    = new DockPanel();
            treeView = new ClassBrowserTreeView();             // treeView must be created first because it's used by CreateToolBar

            toolBar = CreateToolBar("/SharpDevelop/Pads/ClassBrowser/Toolbar");
            panel.Children.Add(toolBar);
            DockPanel.SetDock(toolBar, Dock.Top);

            panel.Children.Add(treeView);

            //treeView.ContextMenu = CreateContextMenu("/SharpDevelop/Pads/UnitTestsPad/ContextMenu");
            projectService.CurrentSolutionChanged += ProjectServiceCurrentSolutionChanged;
            ProjectServiceCurrentSolutionChanged(null, null);

            // Load workspaces from configuration
            treeView.Loaded += (sender, e) => LoadWorkspaces();
        }
示例#4
0
        public ClassBrowserPad(IProjectService projectService)
        {
            this.projectService = projectService;
            panel = new DockPanel();
            treeView = new ClassBrowserTreeView(); // treeView must be created first because it's used by CreateToolBar

            toolBar = CreateToolBar("/SharpDevelop/Pads/ClassBrowser/Toolbar");
            panel.Children.Add(toolBar);
            DockPanel.SetDock(toolBar, Dock.Top);

            panel.Children.Add(treeView);

            //treeView.ContextMenu = CreateContextMenu("/SharpDevelop/Pads/UnitTestsPad/ContextMenu");
            projectService.CurrentSolutionChanged += ProjectServiceCurrentSolutionChanged;
            ProjectServiceCurrentSolutionChanged(null, null);

            // Load workspaces from configuration
            treeView.Loaded += (sender, e) => LoadWorkspaces();
        }