コード例 #1
0
        public SearchResultsPad()
        {
            if (instance != null)
            {
                throw new InvalidOperationException("Cannot create multiple instances");
            }
            instance = this;
            toolBar  = new ToolBar();
            ToolBarTray.SetIsLocked(toolBar, true);
            defaultToolbarItems = ToolBarService.CreateToolBarItems(contentPanel, this, "/SharpDevelop/Pads/SearchResultPad/Toolbar");
            foreach (object toolBarItem in defaultToolbarItems)
            {
                toolBar.Items.Add(toolBarItem);
            }

            contentPlaceholder = new ContentPresenter();
            contentPanel       = new Grid {
                Children = { toolBar, contentPlaceholder }
            };

            contentPanel.RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });
            contentPanel.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });

            Grid.SetRow(contentPlaceholder, 1);
        }
コード例 #2
0
        public SearchResultsPad()
        {
            if (instance != null)
            {
                throw new InvalidOperationException("Cannot create multiple instances");
            }
            instance = this;
            toolBar  = new ToolBar();
            ToolBarTray.SetIsLocked(toolBar, true);
            defaultToolbarItems = ToolBarService.CreateToolBarItems(dockPanel, this, "/SharpDevelop/Pads/SearchResultPad/Toolbar");
            foreach (object toolBarItem in defaultToolbarItems)
            {
                toolBar.Items.Add(toolBarItem);
            }

            DockPanel.SetDock(toolBar, Dock.Top);
            contentPlaceholder = new ContentPresenter();
            dockPanel          = new DockPanel {
                Children = { toolBar, contentPlaceholder }
            };
        }