Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        private static LayerAssembly CreateDomainLayer(ApplicationAssembly app)
        {
            LayerAssembly layer = app.NewLayerAssembly("DomainLayer");

            ModuleAssembly experimentalModule = CreateExperimentalModule(layer);

            return(layer);
        }
Esempio n. 4
0
        private static LayerAssembly CreateDomainLayer(ApplicationAssembly app)
        {
            LayerAssembly layer = app.NewLayerAssembly("DomainLayer");

            ModuleAssembly shapeModule = CreateShapeModule(layer);

            return(layer);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
        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;
        }
Esempio n. 8
0
        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);
        }
Esempio n. 9
0
        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;
        }
Esempio n. 10
0
        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);
        }
Esempio n. 11
0
 public ModuleAssemblyImpl(LayerAssembly layerAssembly, string name, MetaInfo metaInfo)
 {
     this.layerAssembly = layerAssembly;
     this.name = name;
     this.metaInfo = metaInfo;
 }
Esempio n. 12
0
 public ModuleAssemblyImpl(LayerAssembly layerAssembly, string name, MetaInfo metaInfo)
 {
     this.layerAssembly = layerAssembly;
     this.name          = name;
     this.metaInfo      = metaInfo;
 }
Esempio n. 13
0
 public void VisitLayer(LayerAssembly impl)
 {
     throw new NotImplementedException();
 }
Esempio n. 14
0
 public void VisitLayer(LayerAssembly impl)
 {
     throw new NotImplementedException();
 }