Пример #1
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);
        }
Пример #2
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);
        }