public void Handle(BuildHostInstance buildHostInstance, Exception exception) { // reset the host buildHostInstance.Reset(); // and now create an error host and assign that to the build host var errorHost = new DefaultErrorHost <TInstance>(buildHostInstance, LayoutErrorFormat, exception, LayoutContext.Create(buildHostInstance.BuildOwner.ModelBag, buildHostInstance.HostEnvironment.LayoutResolver), buildHostInstance.HostEnvironment.HostSettings); buildHostInstance.SetHost(errorHost); }
public override void Start() { // monitor the build owner for changes in the model(s) state BuildOwner.Changed += (sender, args) => { // record the model value in the model bag BuildOwner.ModelBag.SetModel(args.Change.Container, args.Change.Model, args.Change.MutationId); Record(new ModelChangedEvent(args.Change)); // now create the layout request and send it on its way var changedRequest = new LayoutRequest(LayoutContext.Create(BuildOwner.ModelBag, BuildHostInstance.HostEnvironment.LayoutResolver), args.Change.MutationId); this.Execute(changedRequest, Settings.Mode == LayoutMode.Sync); }; // our initial request var request = new LayoutRequest(LayoutContext.Create(BuildOwner.ModelBag, BuildHostInstance.HostEnvironment.LayoutResolver), BuildOwner.StartMutationId); // execute the first pass Execute(request, Settings.Mode != LayoutMode.Async); }
/// <summary> /// /// </summary> public override void Start() { var request = new LayoutRequest(LayoutContext.Create(BuildOwner.ModelBag, BuildHostInstance.HostEnvironment.LayoutResolver), BuildOwner.StartMutationId); this.Execute(request, Settings.Mode != LayoutMode.Async); }