コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: HtmlAnchor.cs プロジェクト: nikita239/Aspect
        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));
        }