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); })); }
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")); }
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))); }