public void WriteTo(TextWriter writer) { if (Context.Displayable == null || Context.Content == null) { return; } Context.IsEditable = isEditable && ControlPanelExtensions.GetControlPanelState(Context.Html).IsFlagSet(ControlPanelState.DragDrop); var renderer = Context.Html.ResolveService <DisplayableRendererSelector>(); if (swallowExceptions) { try { renderer.Render(Context, writer); } catch (System.Exception ex) { logger.Error(ex); } } else { renderer.Render(Context, writer); } }
public override void RenderPart(System.Web.Mvc.HtmlHelper html, ContentItem part, System.IO.TextWriter writer = null) { bool designMode = ControlPanelExtensions.GetControlPanelState(html).HasFlag(ControlPanelState.DragDrop); html.ViewContext.Writer.Write(GetHtml(part as HtmlAnchor, designMode)); }