private IFubuSparkView getView(Func <ISparkViewEntry> func) { var view = (IFubuSparkView)func().CreateInstance(); view = _service.Modify(view); return(view); }
private IFubuRazorView CreateInstance(bool partialOnly = false) { var currentDescriptor = _viewDescriptor; var returnTemplate = _templateFactory.GetView(currentDescriptor); returnTemplate.OriginTemplate = _viewDescriptor.Template; var currentTemplate = returnTemplate; while (currentDescriptor.Master != null && !partialOnly) { currentDescriptor = currentDescriptor.Master.Descriptor.As <ViewDescriptor <IRazorTemplate> >(); var layoutTemplate = _templateFactory.GetView(currentDescriptor); layoutTemplate.OriginTemplate = returnTemplate.OriginTemplate; currentTemplate.UseLayout(layoutTemplate); currentTemplate = layoutTemplate; } returnTemplate = _service.Modify(returnTemplate); return(returnTemplate); }