예제 #1
0
        protected override DriverResult Display(ElementWrapperPart part, string displayType, dynamic shapeHelper)
        {
            return(ContentShape("Parts_ElementWrapper", () => {
                var describeContext = CreateDescribeContext(part);
                var descriptor = _elementManager.GetElementDescriptorByTypeName(describeContext, part.ElementTypeName);
                var data = ElementDataHelper.Deserialize(part.ElementData);
                var element = _elementManager.ActivateElement(descriptor, e => e.Data = data);
                var elementShape = _elementDisplay.DisplayElement(element, part, displayType);

                return shapeHelper.Parts_ElementWrapper(ElementShape: elementShape);
            }));
        }
예제 #2
0
 public void FromElement(Element element, DescribeElementsContext describeContext, JToken node)
 {
     node["data"]                   = element.Data.Serialize();
     node["htmlId"]                 = element.HtmlId;
     node["htmlClass"]              = element.HtmlClass;
     node["htmlStyle"]              = element.HtmlStyle;
     node["isTemplated"]            = element.IsTemplated;
     node["hasEditor"]              = element.HasEditor;
     node["contentType"]            = element.Descriptor.TypeName;
     node["contentTypeLabel"]       = element.Descriptor.DisplayText.Text;
     node["contentTypeClass"]       = element.DisplayText.Text.HtmlClassify();
     node["contentTypeDescription"] = element.Descriptor.Description.Text;
     node["html"]                   = _shapeDisplay.Display(_elementDisplay.DisplayElement(element, content: describeContext.Content, displayType: "Design"));
 }
예제 #3
0
        private string TokenValue(string elementTypeName, string value)
        {
            var describeContext   = DescribeElementsContext.Empty;
            var elementDescriptor = _elementManager.GetElementDescriptorByTypeName(describeContext, elementTypeName);

            if (elementDescriptor == null)
            {
                return("");
            }

            var element      = _elementManager.ActivateElement(elementDescriptor);
            var elementShape = _elementDisplay.DisplayElement(element, null);
            var elementHtml  = _shapeDisplay.Display(elementShape);

            return(elementHtml);
        }
 private string RenderElement(Element element, DescribeElementsContext describeContext, string displayType = "Design")
 {
     return(_shapeDisplay.Display(_elementDisplay.DisplayElement(element, describeContext.Content, displayType)));
 }