public override void BuildEditor(BuildEditorContext context)
 {
     _drivers.Invoke(driver => {
         var result = driver.BuildEditor(context);
         if (result != null)
             result.Apply(context);
     }, Logger);
 }
        public override void Apply(BuildEditorContext 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 override void Apply(BuildEditorContext context)
 {
     ApplyImplementation(context, null);
 }
        public dynamic BuildEditor(IContent content, string groupId)
        {
            var contentTypeDefinition = content.ContentItem.TypeDefinition;
            string stereotype;
            if (!contentTypeDefinition.Settings.TryGetValue("Stereotype", out stereotype))
                stereotype = "Content";

            var actualShapeType = stereotype + "_Edit";

            dynamic itemShape = CreateItemShape(actualShapeType);
            itemShape.ContentItem = content.ContentItem;

            // adding an alternate for [Stereotype]_Edit__[ContentType] e.g. Content-Menu.Edit
            ((IShape)itemShape).Metadata.Alternates.Add(actualShapeType + "__" + content.ContentItem.ContentType);

            var context = new BuildEditorContext(itemShape, content, groupId, _shapeFactory);
            BindPlacement(context, null, stereotype);

            _handlers.Value.Invoke(handler => handler.BuildEditor(context), Logger);

            return context.Shape;
        }
 public virtual void Apply(BuildEditorContext context)
 {
 }
 protected virtual void BuildEditorShape(BuildEditorContext context)
 {
 }
 public override void Apply(BuildEditorContext context)
 {
     var templateShape = context.New.EditorTemplate(TemplateName: TemplateName, Model: Model, Prefix: Prefix);
     context.Shape.Zones[Zone].Add(templateShape, Position);
 }
 protected override void BuildEditorShape(BuildEditorContext context, TContent instance)
 {
 }