public override void BuildDisplay(BuildDisplayContext context)
 {
     _drivers.Invoke(driver => {
         var result = driver.BuildDisplay(context);
         if (result != null)
             result.Apply(context);
     }, Logger);
 }
        public override void Apply(BuildDisplayContext context)
        {
            foreach (var result in _results) {

                // copy the ContentPart which was used to render this result to its children
                // so they can assign it to the concrete shapes
                if (result.ContentPart == null && ContentPart != null) {
                    result.ContentPart = ContentPart;
                }

                // copy the ContentField which was used to render this result to its children
                // so they can assign it to the concrete shapes
                if (result.ContentField == null && ContentField != null) {
                    result.ContentField = ContentField;
                }

                result.Apply(context);
            }
        }
        public dynamic BuildDisplay(IContent content, string displayType, string groupId)
        {
            var contentTypeDefinition = content.ContentItem.TypeDefinition;
            string stereotype;
            if (!contentTypeDefinition.Settings.TryGetValue("Stereotype", out stereotype))
                stereotype = "Content";

            var actualShapeType = stereotype;
            var actualDisplayType = string.IsNullOrWhiteSpace(displayType) ? "Detail" : displayType;

            dynamic itemShape = CreateItemShape(actualShapeType);
            itemShape.ContentItem = content.ContentItem;
            itemShape.Metadata.DisplayType = actualDisplayType;

            var context = new BuildDisplayContext(itemShape, content, actualDisplayType, groupId, _shapeFactory);
            var workContext = _workContextAccessor.GetContext(_requestContext.HttpContext);
            context.Layout = workContext.Layout;

            BindPlacement(context, actualDisplayType, stereotype);

            _handlers.Value.Invoke(handler => handler.BuildDisplay(context), Logger);
            return context.Shape;
        }
 public override void Apply(BuildDisplayContext context)
 {
     ApplyImplementation(context, context.DisplayType);
 }
 public virtual void Apply(BuildDisplayContext context)
 {
 }
예제 #6
0
 protected virtual void BuildDisplayShape(BuildDisplayContext context)
 {
 }
 public override void Apply(BuildDisplayContext context)
 {
     var templateShape = context.New.DisplayTemplate(TemplateName: TemplateName, Model: Model, Prefix: Prefix);
     context.Shape.Zones[Zone].Add(templateShape, Position);
 }
 protected override void BuildDisplayShape(BuildDisplayContext context, TContent instance)
 {
 }