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)); }
public SmartContentEditor GetSmartContentEditor(string contentSourceId) { Debug.Assert(_smartContentEditorCache != null, "Must CreateSidebarControl before calling GetSmartContentEditor."); return(_smartContentEditorCache.GetSmartContentEditor(contentSourceId)); }