예제 #1
0
        public Template Build(TemplateSurrogate surrogate)
        {
            var componentBuilder = new DomainBuildingComponentSurrogateVisitor();
            var amendmentBuilder = new DomainBuildingAmendmentSurrogateVisitor();

            return new Template(
                this.path,
                surrogate.Components.Select(c => c.Accept(componentBuilder)).ToArray(),
                surrogate.Amendments.Select(a => a.Accept(amendmentBuilder)).ToArray());
        }
        public WidgetSpecification Build(WidgetSpecificationSurrogate surrogate)
        {
            var componentBuilder = new DomainBuildingComponentSurrogateVisitor();
            var amendmentBuilder = new DomainBuildingAmendmentSurrogateVisitor();

            return new WidgetSpecification(
                this.name,
                surrogate.PropertySpecifications.Select(this.BuildPropertySpecification).ToArray(),
                surrogate.Components.Select(c => c.Accept(componentBuilder)).ToArray(),
                (surrogate.Amendments ?? Enumerable.Empty<AmendmentSurrogate>()).Select(a => a.Accept(amendmentBuilder)).ToArray(),
                surrogate.Category);
        }