private static ModuleAssembly CreateExperimentalModule(LayerAssembly layer) { ModuleAssembly module = layer.NewModuleAssembly("ExperimentalModule"); module .AddEntities() .VisibleIn(Visibility.Module); module .AddServices() .Include<CustomerRepositoryService>() .WithConcern<GenericTracingConcern>() .VisibleIn(Visibility.Layer); module .AddValues() .Include<AddressValue>(); module .AddTransients() .Include<CustomerTransient>() .Include<ContactTransient>() .WithConcern<GenericTracingConcern>() // .WithConcern<SayHelloConcern>() .WithSideEffect<SayHelloSideEffect>(); return module; }
private static ModuleAssembly CreateExperimentalModule(LayerAssembly layer) { ModuleAssembly module = layer.NewModuleAssembly("ExperimentalModule"); module .AddEntities() .VisibleIn(Visibility.Module); module .AddServices() .Include <CustomerRepositoryService>() .WithConcern <GenericTracingConcern>() .VisibleIn(Visibility.Layer); module .AddValues() .Include <AddressValue>(); module .AddTransients() .Include <CustomerTransient>() .Include <ContactTransient>() .WithConcern <GenericTracingConcern>() // .WithConcern<SayHelloConcern>() .WithSideEffect <SayHelloSideEffect>(); return(module); }
private static LayerAssembly CreateDomainLayer(ApplicationAssembly app) { LayerAssembly layer = app.NewLayerAssembly("DomainLayer"); ModuleAssembly experimentalModule = CreateExperimentalModule(layer); return(layer); }
private static LayerAssembly CreateDomainLayer(ApplicationAssembly app) { LayerAssembly layer = app.NewLayerAssembly("DomainLayer"); ModuleAssembly shapeModule = CreateShapeModule(layer); return(layer); }
private static void Main() { var f = new ApplicationAssemblyFactory(); ApplicationAssembly app = f.NewApplicationAssembly(); LayerAssembly domainLayer = CreateDomainLayer(app); ApplicationModel applicationModel = ApplicationModel.NewModel(app); ApplicationInstance applicationInstance = applicationModel.NewInstance(); Run(applicationInstance); }
private static ModuleAssembly CreateShapeModule(LayerAssembly layer) { ModuleAssembly module = layer.NewModuleAssembly("ShapeModule"); module.AddTransients() .Include <DrawingService>(); module .AddTransients() .Include <RectangleShape>() .Include <EllipseShape>() .Include <LineShape>() .Include <SplineShape>() //.Include<DescriptionTransient>() .Include <GroupShape>() ; return(module); }
public static LayerModel NewModel(LayerAssembly layer) { var moduleModels = new List<ModuleModel>(); foreach (ModuleAssemblyImpl module in layer.Modules) { ModuleModel moduleModel = module.AssembleModule(); moduleModels.Add(moduleModel); } //TODO:fix usedLayerModel var usedLayersModel = new List<LayerModel>(); var layerModel = new LayerModel(layer.Name, layer.MetaInfo, usedLayersModel, moduleModels); return layerModel; }
public static LayerModel NewModel(LayerAssembly layer) { var moduleModels = new List <ModuleModel>(); foreach (ModuleAssemblyImpl module in layer.Modules) { ModuleModel moduleModel = module.AssembleModule(); moduleModels.Add(moduleModel); } //TODO:fix usedLayerModel var usedLayersModel = new List <LayerModel>(); var layerModel = new LayerModel(layer.Name, layer.MetaInfo, usedLayersModel, moduleModels); return(layerModel); }
private static ModuleAssembly CreateShapeModule(LayerAssembly layer) { ModuleAssembly module = layer.NewModuleAssembly("ShapeModule"); module.AddTransients() .Include<DrawingService>(); module .AddTransients() .Include<RectangleShape>() .Include<EllipseShape>() .Include<LineShape>() .Include<SplineShape>() //.Include<DescriptionTransient>() .Include<GroupShape>() ; return module; }
private void Form1_Load(object sender, EventArgs e) { var f = new ApplicationAssemblyFactory(); ApplicationAssembly app = f.NewApplicationAssembly(); LayerAssembly domainLayer = CreateDomainLayer(app); ApplicationModel applicationModel = ApplicationModel.NewModel(app); ApplicationInstance applicationInstance = applicationModel.NewInstance(); Module shapeModule = applicationInstance.FindModule("DomainLayer", "ShapeModule"); var drawing = shapeModule.TransientBuilderFactory.NewTransient <Drawing>(); var rectangle = drawing.Create <RectangleShape>(); drawing.Remove(rectangle); rectangle.SetBounds(100, 100, 200, 200); rectangle.Rotate(1.5); var ellipse = drawing.Create <EllipseShape>(); ellipse.SetBounds(300, 100, 200, 300); var line = drawing.Create <LineShape>(); line.MoveNode(0, 50, 150); line.MoveNode(1, 500, 300); var spline = drawing.Create <SplineShape>(); spline.MoveNode(0, 50, 150); spline.MoveNode(1, 150, 50); spline.MoveNode(2, 200, 150); GroupShape group = drawing.Group(ellipse, rectangle, line, spline); this.elements.Add(group); }
public ModuleAssemblyImpl(LayerAssembly layerAssembly, string name, MetaInfo metaInfo) { this.layerAssembly = layerAssembly; this.name = name; this.metaInfo = metaInfo; }
public void VisitLayer(LayerAssembly impl) { throw new NotImplementedException(); }