private ContentWidget CreateViewPart(IViewPart view) { ContentWidget content = new ContentWidget(view, m_IconResourceService, m_KeyBindingService, false); AttachViewsToolbars(content); return(content); }
private bool ExistsContentConfiguration(ContentWidget content, out ContentConfiguration contentConfig) { //foreach (ContentConfiguration contentConfiguration in PageConfig.Contents) //{ // if (contentConfiguration.Id != content.ViewPart.TypeId) // { // continue; // } // contentConfig = contentConfiguration; // return true; //} contentConfig = null; return(false); }
private void CreateAndShowView(IViewPart view) { ContentWidget content = CreateViewPart(view); if (GetPreferred(view.Layout)) { Page.Show(content, true); m_viewPart1 = view; m_contentWidget1 = content; } else { Page.Show(content, false); m_viewPart2 = view; m_contentWidget2 = content; } }
private void AttachViewsToolbars(ContentWidget content) { if (content.ViewPart.Toolbars.Count > 0) { foreach (IToolbarPart toolbarPart in content.ViewPart.Toolbars) { if (toolbarPart.Widget == null) { ToolStrip strip = new ToolStrip();// = CreateStrip(toolbarPart, false);// <-------------------------------------------- if (strip.Items.Count == 0) { continue; } strip.GripStyle = ToolStripGripStyle.Hidden; strip.AllowMerge = false; content.ToolStripContainer.TopToolStripPanel.Controls.Add(strip); } } } }