public override void Apply(ModelDisplayShapeContext context) { foreach (var result in _results) { result.Apply(context); } }
public void BuildDisplayShape(object model, dynamic root, string displayType, string stereotype, ModelShapeContext parentContext = null) { var context = new ModelDisplayShapeContext(model, root, displayType, Shape, parentContext) { Stereotype = stereotype }; //, prefix); BindPlacement(context, displayType, stereotype); foreach (var driver in Drivers) { var result = driver.BuildDisplay(context); if (result != null) { result.Apply(context); } } // Chain sub results? // They are applied to the same base object (as opposed to rendering an entirely new shape with its own zones) // TODO: Could be nice to chain from displays to editors and back (although then we'd always need the updater)... foreach (var chain in context.ChainedResults) { BuildDisplayShape(chain.Model, chain.Root ?? root, chain.DisplayType ?? displayType, stereotype, context); // Fire an event so parent shape can perform work after the update chain.OnCompleted(context); } // Done }
ModelDriverResult IModelDriver.BuildDisplay(ModelDisplayShapeContext context) { if (context.Model is T) { return(Display((T)context.Model, context.New, context)); } return(null); }
public override void Apply(ModelDisplayShapeContext context) { context.ChainedResults.Add(new ModelChainContext() { Model = _model, Root = _shape, ShapeType = _shapeType, DisplayType = _displayType, Prefix = _prefix }); }
public override void Apply(ModelDisplayShapeContext context) { var chain = new ModelChainContext() { Model = _model, Prefix = _prefix }; if (_onCompleted!=null) { chain.Completed += _onCompleted; } context.ChainedResults.Add(chain); }
public override void Apply(ModelDisplayShapeContext context) { var chain = new ModelChainContext() { Model = _model, Prefix = _prefix }; if (_onCompleted != null) { chain.Completed += _onCompleted; } context.ChainedResults.Add(chain); }
public virtual void Apply(ModelDisplayShapeContext context) { }
public override void Apply(ModelDisplayShapeContext context) { ApplyImplementation(context, context.DisplayType); }
protected abstract ModelDriverResult Display(T model, dynamic shapeHelper, ModelDisplayShapeContext context);