Esempio n. 1
0
        public virtual string GetEditable(Context context, string key, EditableOptions options)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            IHtmlString html = null;

            context.Stack(() =>
            {
                html = Html.SnippetInternal(
                    key,
                    options.Type ?? "html",
                    options.Escape.GetValueOrDefault(false),
                    options.Tag ?? "div",
                    options.CssClass,
                    options.Liquid.GetValueOrDefault(true),
                    context,
                    options.Default);
            });

            return(html == null ? null : html.ToString());
        }
Esempio n. 2
0
        public virtual string GetEditable(Context context, string key, EditableOptions options)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            using (var serviceContext = PortalViewContext.CreateServiceContext())
            {
                var attachedEntity   = serviceContext.MergeClone(Entity.Attributes.ContainsKey(key) ? Entity : FullEntity);
                var portalViewEntity = PortalViewContext.GetEntity(serviceContext, attachedEntity);

                IHtmlString html = null;

                context.Stack(() =>
                {
                    html = Html.AttributeInternal(
                        portalViewEntity.GetAttribute(key),
                        options.Type ?? "html",
                        options.Title,
                        options.Escape.GetValueOrDefault(false),
                        options.Tag ?? "div",
                        options.CssClass,
                        options.Liquid.GetValueOrDefault(true),
                        context,
                        options.Default);
                });

                return(html == null ? null : html.ToString());
            }
        }
 public string GetEditable(Context context, string key, EditableOptions options)
 {
     return(Entity == null ? null : Entity.GetEditable(context, key, options));
 }
Esempio n. 4
0
        public override string GetEditable(Context context, EditableOptions options)
        {
            var html = Html.WebLinkSetEditingMetadata(WebLinkSet);

            return(html == null ? null : html.ToString());
        }
Esempio n. 5
0
        public virtual string GetEditable(Context context, EditableOptions options)
        {
            var html = Html.EntityEditingMetadata(ViewEntity);

            return(html == null ? null : html.ToString());
        }