public SmartContentEditor GetSmartContentEditor(string contentSourceId)
        {
            if (_smartContentEditorCache == null)
            {
                // We need to create the smart content editor cache, if we have not already done so.
                ContentSourceSidebarControl contentSourceSidebarControl = GetSidebarControlOfType(typeof(ContentSourceSidebarControl)) as ContentSourceSidebarControl;
                if (contentSourceSidebarControl == null)
                {
                    foreach (SidebarEntry entry in _sidebars)
                    {
                        if (entry.Sidebar is ContentSourceSidebar)
                        {
                            contentSourceSidebarControl = CreateAndInitializeSidebar(entry.Sidebar) as ContentSourceSidebarControl;
                            Debug.Assert(contentSourceSidebarControl != null);

                            entry.SidebarControl         = contentSourceSidebarControl;
                            entry.SidebarControl.Visible = entry.SidebarControl.Controls.Count > 0;
                            break;
                        }
                    }
                }
                _smartContentEditorCache = contentSourceSidebarControl;
            }
            Debug.Assert(_smartContentEditorCache != null);
            return(_smartContentEditorCache.GetSmartContentEditor(contentSourceId));
        }
Пример #2
0
        public SidebarControl CreateSidebarControl(ISidebarContext sidebarContext)
        {
            ContentSourceSidebarControl sidebarControl = new ContentSourceSidebarControl(sidebarContext, _context);

            _smartContentEditorCache = sidebarControl;
            return(sidebarControl);
        }
 public SidebarControl CreateSidebarControl(ISidebarContext sidebarContext)
 {
     ContentSourceSidebarControl sidebarControl = new ContentSourceSidebarControl(sidebarContext, _context);
     _smartContentEditorCache = sidebarControl;
     return sidebarControl;
 }