Example #1
0
        private MainWindow HelloWorld()
        {
            MainWindow mainWindow = new MainWindow("MainWindow title");

            mainWindow.WireTo(new Text("Hello world.")
            {
                FontSize = 200
            });
            return(mainWindow);
        }
Example #2
0
        private MainWindow CalculatorBasicHandWired()
        {
            MainWindow mainWindow = new MainWindow("Calculator");
            var        Result1    = new Text()
            {
                FontSize = 50
            };
            var Formula1 = new Formula()
            {
                Lambda2 = (x, y) => x + y
            };

            mainWindow
            .WireTo(new Vertical()
                    .WireTo(new TextBox()
            {
                FontSize = 50
            }
                            .WireTo(new StringToNumber <double>()
                                    .WireTo(new DataFlowConnector <double>()
                                            .WireFrom(Formula1
                                                      .WireTo(new StringFormat <double, double>("Ans={0}")
                                                              .WireTo(Result1)
                                                              )
                                                      )
                                            )
                                    )
                            )
                    .WireTo(new TextBox()
            {
                FontSize = 50
            }
                            .WireTo(new StringToNumber <double>()
                                    .WireTo(new DataFlowConnector <double>()
                                            .WireFrom(Formula1)
                                            )
                                    )
                            )
                    .WireTo(Result1)
                    );
            return(mainWindow);
        }
Example #3
0
        // TBD split this constructor up into 5 separate user story abstractions in a new User stories layer
        // Do we need a layer called plug-in to pul this off?
        // or can each user stor object have some public instances that get wired by the us


        private Application()
        {
            // First part of the code is to set up a real farming device simulator instance that we configure with mock data.
            // In the real application, this would be a real farming device connected to the physical COM port of the PC.
            // This simulated device gets wired to the COMPort abstraction and pretends to be connected to a real serial COM port.
            // The simulated device is not part of the application, so is not shown on the application-diagram even though we instantiate and configure it here.
            // The simulated device emulates the real devices ability to receive SCP commands and respond to them.

            var simulatedExternalDevice = new RealFarmingDeviceSimulator();

            // Configure the simulated device with some session data
            // Farmers call their files inside devices "sessions". They can configure the fields that they want to use, so here we have three sessions, each with different fields.
            simulatedExternalDevice.AddSession(name: "session0", date: "2021-02-28", columns: new[] { "F01FID", "F11EID" });
            simulatedExternalDevice.AddSession(name: "session1", date: "2021-03-31", columns: new[] { "F01FID", "F11EID", "F10Weight" });
            simulatedExternalDevice.AddSession(name: "session2", date: "2021-04-30", columns: new[] { "F01FID", "F11EID", "F10Weight", "F12Remark" });
            simulatedExternalDevice.AddSessionData(index: 0, sessionData: new[] { "1", "EID0000000000000" });
            simulatedExternalDevice.AddSessionData(index: 0, sessionData: new[] { "2", "EID0000000000001" });
            simulatedExternalDevice.AddSessionData(index: 1, sessionData: new[] { "013", "EID0000000000010", "342" });
            simulatedExternalDevice.AddSessionData(index: 1, sessionData: new[] { "001", "EID0000000000011", "373" });
            simulatedExternalDevice.AddSessionData(index: 1, sessionData: new[] { "002", "EID0000000000012", "304" });
            simulatedExternalDevice.AddSessionData(index: 2, sessionData: new[] { "0123", "EID0000000000021", "405", "healthy" });
            simulatedExternalDevice.AddSessionData(index: 2, sessionData: new[] { "1023", "EID0000000000022", "376", "pregnant" });
            simulatedExternalDevice.AddSessionData(index: 2, sessionData: new[] { "0412", "EID0000000000023", "354", "black spot" });
            simulatedExternalDevice.AddSessionData(index: 2, sessionData: new[] { "0219", "EID0000000000024", "395", "lame" });



// -------------------------- BEGIN CODE MANUALLY GENERATED FROM DIAGRAM --------------------------------------------------------------
            // The following code has been manually generated from the diagram in application-diagram.drawio (read-only version in application-diagram.pdf)
            // Refer to that diagram for how this application works, not this code.
            // Also application.md is a commentary on reading the diagram.
            // Take an interest in this code if:
            // 1. You want to understand how the diagram was hand-coded
            // 2. You want to know all the mechanics of how the ALA diagram was made to actually execute
            // 3. You have modified the diagram and need to correspondingly modify this code


            // First instantiate any domain abstractions that we can't instantiate anonymously in the later code because they need to be referred to by name because the diagram has circular wiring:

            var saveFileBrowser = new SaveFileBrowser(title: "Save file", extension: "CSV");
            var textConnected   = new Text("Connected", false)
            {
                Color = Brushes.Green
            };
            var textSearching = new Text("Searching for a device...")
            {
                Color = Brushes.Red
            };
            var scpProtocol = new SCPProtocol();
            var arbitrator  = new Arbitrator()
            {
                InstanceName = "scpDevice"
            };
            var ignoredDataFlowConnector = new DataFlowConnector <string>();
            var sessionListScp           = new SCPSessions()
            {
                InstanceName = "sessionList"
            };
            var sessionDataScp = new SCPData()
            {
                InstanceName = "forGrid"
            };
            var sessionDataScpImport = new SCPData()
            {
                InstanceName = "import"
            };
            var saveToCsvFileTransact = new Transfer()
            {
                InstanceName = "save to csv file transact", AutoLoadNextBatch = true
            };
            var sessionListGrid = new Grid()
            {
                InstanceName = "sessions", RowHeight = 50, PrimaryKey = "index"
            };
            var sessionDataGrid = new Grid()
            {
                InstanceName = "data"
            };
            var csvFileReaderWriter = new CSVFileReaderWriter();
            var comPort             = new COMPort();


            // Now do all the wiring of the diagram
            // Note any instances of domain abstractions not already instantiated anonymously in this code.
            // Note that a.wireTo(b) is an extension method that uses reflection to wire 'a' to 'b' via 'ports'. The ports on 'a' and 'b' must be a programmming paradigm interface of the same interface type - 'a' must have a private field of the interface and 'b' must implement the interface.
            // Note that the fluent style is used: wireTo returns its first argument, allowing you to call wireTo again to wire it some thing else.
            // Note that InstanceName properties are not needed by the code - they are just to help when debugging because if there are multiple instances of the same domain abstraction you often dont know which instance you have break-pointed into.
            // Sometimes WireTo has a second parameter which is the name of the specific port it is wiring to. This ensures wiring to the correct port if there is more than one port of a given type.
            mainWindow
            // UI
            .WireTo(new Vertical(true)
            {
                Layouts = new int[] { 0, 0, 2, 0 }
            }
                    .WireTo(new Horizontal()
            {
                InstanceName = "menubar"
            }
                            .WireTo(new Menubar()
                                    .WireTo(new Menu("File")
                                            .WireTo(new MenuItem("Import from device")
                                                    .WireTo(new Wizard("Where do you want to put it?")
                                                            .WireTo(new RadioButton("Local CSV file")
                                                                    .WireTo(saveFileBrowser)
                                                                    )
                                                            .WireTo(new RadioButton("Cloud"))
                                                            )
                                                    )
                                            .WireTo(new MenuItem("Exit")
                                                    .WireTo(mainWindow)
                                                    )
                                            )
                                    )
                            )
                    .WireTo(new Horizontal()
            {
                InstanceName = "toolbar"
            }
                            .WireTo(new Toolbar()
                                    .WireTo(new Tool("5000Import.png")
                                            .WireTo(saveFileBrowser
                                                    .WireTo(csvFileReaderWriter, "dataFlowOutputFilePathNames")
                                                    .WireTo(saveToCsvFileTransact
                                                            .WireTo(sessionDataScpImport
                                                                    .WireTo(scpProtocol, "SCPPort")
                                                                    .WireTo(arbitrator, "arbitrator")
                                                                    , "tableDataFlowSource")
                                                            .WireTo(csvFileReaderWriter, "tableDataFlowDestination")
                                                            , "fileSelected")
                                                    )
                                            )
                                    )
                            )
                    .WireTo(new Horizontal()
            {
                InstanceName = "mainPanel", Ratios = new int[] { 1, 3 }
            }
                            .WireTo(sessionListGrid
                                    .WireTo(sessionListScp
                                            .WireTo(scpProtocol, "requestResponseDataFlow")
                                            .WireTo(arbitrator, "arbitrator")
                                            , "dataSource")
                                    .WireTo(sessionListScp, "dataFlowSelectedPrimaryKey")
                                    .WireTo(sessionDataGrid
                                            .WireTo(sessionDataScp
                                                    .WireTo(scpProtocol, "SCPPort")
                                                    .WireTo(arbitrator, "arbitrator")
                                                    , "dataSource")
                                            , "eventRowSelected")
                                    )
                            .WireTo(sessionDataGrid)
                            )
                    .WireTo(new Horizontal()
            {
                InstanceName = "statusbar"
            }
                            .WireTo(new Statusbar()
                                    .WireTo(textConnected)
                                    .WireTo(textSearching)
                                    )
                            )
                    )
            .WireTo(new Timer()
            {
                Delay = 3000
            }
                    .WireTo(new SCPSense()
            {
                InstanceName = "scpSence"
            }
                            .WireTo(arbitrator, "arbitrator")
                            .WireTo(scpProtocol
                                    .WireTo(comPort
                                            .WireTo(scpProtocol, "outputForCharactersReceiveFromTheCOMPort")
                                            .WireTo(simulatedExternalDevice
                                                    .WireTo(comPort, "responseOutput")
                                                    , "virtualComPortTx")
                                            , "scpCommand")
                                    , "requestResponseDataFlow")
                            .WireTo(new DataFlowConnector <bool>()
                                    .WireTo(textConnected)
                                    .WireTo(new Not()
                                            .WireTo(textSearching)
                                            )
                                    .WireTo(new ToEvent <bool>()
                                            .WireTo(sessionListGrid)
                                            )
                                    , "IsDeviceConnected")
                            )
                    , "appStart");
            // -------------------------- END CODE MANUALLY GENERATED FROM DIAGRAM --------------------------------------------------------------



            // See logging.cs for an explantion of why we wire up logging instead of using a programming paradigm layer abstraction for it

            // This logging instance is configured to output to the specified file
            // We will all the logging output ports of all the programming paradigms to it
            var debugLoggerToFile = new LoggerToFile(@"C:\ProgramData\Example_ALA\debugLog.txt")
            {
                InstanceName = "debugLoggerToFile"
            };
            var debugLoggerToWindow = new LoggerToWindow()
            {
                InstanceName = "debugLoggerToWindow"
            };

            // This wires the static diagnostic output port of WireManyPorts abstraction to logging so we get diagnostic output of it wiring up all the other diagnostic outputs
            WireMany.diagnosticOutput += debugLoggerToWindow.WriteLine;
            WireMany.diagnosticOutput += wiringLoggerToFile.WriteLine;

            // this method call will look through all the domain abstractions and wire all their static event diagnosticOutput ports to debugLoggingToWindow
            // doing the equivalent of the lines below without us having to do every one individually
            WireMany.WireManyTo("DomainAbstractions", "diagnosticOutput", debugLoggerToWindow, "WriteLine");
            WireMany.WireManyTo("DomainAbstractions", "diagnosticOutput", debugLoggerToFile, "WriteLine");

            // These manual wirings are how we used to do it - they are now done by WireMany above
            // Do it this way to override anything that you want to go to a special place
            // Arbitrator.diagnosticOutput += (s) => Debug.WriteLine(s);
            // SCPProtocol.diagnosticOutput += (s) => Debug.WriteLine(s);
            // Grid.diagnosticOutput += (s) => Debug.WriteLine(s);
            // CSVFileReaderWriter.diagnosticOutput += (s) => Debug.WriteLine(s);
            // Transfer.diagnosticOutput += (s) => Debug.WriteLine(s);
        }
Example #4
0
        private Application()
        {
            // BEGIN AUTO-GENERATED INSTANTIATIONS FOR SnakeALA.xmind
            Apply <KeyEventArgs, object> id_94b4d7a7a9d44167b274549f91425e64 = new Apply <KeyEventArgs, object>()
            {
                InstanceName = "Default", Lambda = args => { if (args.Key == Key.A)
                                                             {
                                                                 return("L" as object);
                                                             }
                                                             if (args.Key == Key.D)
                                                             {
                                                                 return("R" as object);
                                                             }
                                                             if (args.Key == Key.W)
                                                             {
                                                                 return("U" as object);
                                                             }
                                                             if (args.Key == Key.S)
                                                             {
                                                                 return("D" as object);
                                                             }
                                                             return("" as object); }
            };
            Cast <object, Vector> id_eee7d6d4227a44d096d1f1f1dbc62fee = new Cast <object, Vector>()
            {
                InstanceName = "Default"
            };
            Data <object> id_14180dadcc5a42299b907ebbe26ecaa5 = new Data <object>()
            {
                InstanceName = "Default", storedData = "U" as object
            };
            DataFlowConnector <Canvas> mainCanvas = new DataFlowConnector <Canvas>()
            {
                InstanceName = "mainCanvas"
            };
            DataFlowConnector <object> id_7cc2c7f3a9ba465b917ab80eca883d09 = new DataFlowConnector <object>()
            {
                InstanceName = "Default"
            };
            DataFlowConnector <object> scalar = new DataFlowConnector <object>()
            {
                InstanceName = "scalar", Data = 25
            };
            DataFlowConnector <object> snakeDirection = new DataFlowConnector <object>()
            {
                InstanceName = "snakeDirection"
            };
            EventConnector id_3babe233bb07413086c85807fcc6fff4 = new EventConnector()
            {
                InstanceName = "Default"
            };
            GameScreen id_568c58e3544e4ba1a0d1f0ad64eb4672 = new GameScreen()
            {
                InstanceName = "Default"
            };
            KeyEvent id_4f46cbcb3ae1463f8dcf949245e8e01c = new KeyEvent("KeyDown")
            {
                InstanceName = "Default"
            };
            MovingRender id_4858115ca72b43cbb978b92bef31c12d = new MovingRender()
            {
                InstanceName = "Default"
            };
            MovingRender id_4b39dde997d14570bd750e476b61a99d = new MovingRender()
            {
                InstanceName = "Default"
            };
            MovingRender id_5949b1f2856d46deb2148d18073dda8b = new MovingRender()
            {
                InstanceName = "Default"
            };
            MovingRender id_6c4b8472494b40aa99f9f2754a5a3a10 = new MovingRender()
            {
                InstanceName = "Default"
            };
            MovingRender snakeHead = new MovingRender()
            {
                InstanceName = "snakeHead", Position = new Point(500, 500)
            };
            Operation <object> moveSnake = new Operation <object>()
            {
                InstanceName = "moveSnake", Lambda = ops => { var direction = ops[0] as string; var vertScalar = (int)ops[1]; var horizScalar = (int)ops[1]; if (direction == "U")
                                                              {
                                                                  return(new Vector(0, -vertScalar));
                                                              }
                                                              else if (direction == "D")
                                                              {
                                                                  return(new Vector(0, vertScalar));
                                                              }
                                                              else if (direction == "L")
                                                              {
                                                                  return(new Vector(-horizScalar, 0));
                                                              }
                                                              else if (direction == "R")
                                                              {
                                                                  return(new Vector(horizScalar, 0));
                                                              }
                                                              else
                                                              {
                                                                  return(new Vector(0, 0));
                                                              } }
            };
            Operation <object> validateMovementDirection = new Operation <object>()
            {
                InstanceName = "validateMovementDirection", Lambda = ops => { var _set = new HashSet <string> {
                                                                                  "U", "D", "L", "R"
                                                                              }; if (_set.Contains(ops[0] as string))
                                                                              {
                                                                                  return(ops[0]);
                                                                              }
                                                                              else
                                                                              {
                                                                                  return(ops[1]);
                                                                              } }
            };
            Timer gameTimer = new Timer()
            {
                InstanceName = "gameTimer", Interval = 1.0 / 30
            };

            // END AUTO-GENERATED INSTANTIATIONS FOR SnakeALA.xmind

            // BEGIN AUTO-GENERATED WIRING FOR SnakeALA.xmind
            mainWindow.WireTo(id_568c58e3544e4ba1a0d1f0ad64eb4672, "iuiStructure");                                // (@MainWindow (mainWindow).iuiStructure) -- [IUI] --> (GameScreen (id_568c58e3544e4ba1a0d1f0ad64eb4672).child)
            mainWindow.WireTo(id_3babe233bb07413086c85807fcc6fff4, "appStart");                                    // (@MainWindow (mainWindow).appStart) -- [IEvent] --> (EventConnector (id_3babe233bb07413086c85807fcc6fff4).start)
            id_568c58e3544e4ba1a0d1f0ad64eb4672.WireTo(id_4f46cbcb3ae1463f8dcf949245e8e01c, "eventHandlers");      // (GameScreen (id_568c58e3544e4ba1a0d1f0ad64eb4672).eventHandlers) -- [IEventHandler] --> (KeyEvent (id_4f46cbcb3ae1463f8dcf949245e8e01c).eventHandler)
            id_568c58e3544e4ba1a0d1f0ad64eb4672.WireTo(mainCanvas, "canvasOutput");                                // (GameScreen (id_568c58e3544e4ba1a0d1f0ad64eb4672).canvasOutput) -- [IDataFlow<Canvas>] --> (DataFlowConnector<Canvas> (mainCanvas).input)
            id_4f46cbcb3ae1463f8dcf949245e8e01c.WireTo(id_94b4d7a7a9d44167b274549f91425e64, "argsOutput");         // (KeyEvent (id_4f46cbcb3ae1463f8dcf949245e8e01c).argsOutput) -- [IDataFlow<KeyEventArgs>] --> (Apply<KeyEventArgs,object> (id_94b4d7a7a9d44167b274549f91425e64).input)
            id_4f46cbcb3ae1463f8dcf949245e8e01c.WireTo(validateMovementDirection, "eventHappened");                // (KeyEvent (id_4f46cbcb3ae1463f8dcf949245e8e01c).eventHappened) -- [IEvent] --> (Operation<object> (validateMovementDirection).startOperation)
            id_94b4d7a7a9d44167b274549f91425e64.WireTo(id_7cc2c7f3a9ba465b917ab80eca883d09, "output");             // (Apply<KeyEventArgs,object> (id_94b4d7a7a9d44167b274549f91425e64).output) -- [IDataFlow<object>] --> (DataFlowConnector<object> (id_7cc2c7f3a9ba465b917ab80eca883d09).input)
            validateMovementDirection.WireTo(id_7cc2c7f3a9ba465b917ab80eca883d09, "operands");                     // (Operation<object> (validateMovementDirection).operands) -- [IDataFlowB<object>] --> (DataFlowConnector<object> (id_7cc2c7f3a9ba465b917ab80eca883d09).outputsB)
            validateMovementDirection.WireTo(snakeDirection, "operands");                                          // (Operation<object> (validateMovementDirection).operands) -- [IDataFlowB<object>] --> (@DataFlowConnector<object> (snakeDirection).outputsB)
            validateMovementDirection.WireTo(snakeDirection, "operationResultOutput");                             // (Operation<object> (validateMovementDirection).operationResultOutput) -- [IDataFlow<object>] --> (DataFlowConnector<object> (snakeDirection).input)
            mainCanvas.WireTo(snakeHead, "outputs");                                                               // (DataFlowConnector<Canvas> (mainCanvas).outputs) -- [IDataFlow<Canvas>] --> (MovingRender (snakeHead).mainCanvasInput)
            snakeHead.WireTo(id_6c4b8472494b40aa99f9f2754a5a3a10, "lastPositionOutput");                           // (MovingRender (snakeHead).lastPositionOutput) -- [IDataFlow<Point>] --> (MovingRender (id_6c4b8472494b40aa99f9f2754a5a3a10).moveToPosition)
            mainCanvas.WireTo(id_6c4b8472494b40aa99f9f2754a5a3a10, "outputs");                                     // (@DataFlowConnector<Canvas> (mainCanvas).outputs) -- [IDataFlow<Canvas>] --> (MovingRender (id_6c4b8472494b40aa99f9f2754a5a3a10).mainCanvasInput)
            id_6c4b8472494b40aa99f9f2754a5a3a10.WireTo(id_4b39dde997d14570bd750e476b61a99d, "lastPositionOutput"); // (MovingRender (id_6c4b8472494b40aa99f9f2754a5a3a10).lastPositionOutput) -- [IDataFlow<Point>] --> (MovingRender (id_4b39dde997d14570bd750e476b61a99d).moveToPosition)
            mainCanvas.WireTo(id_4b39dde997d14570bd750e476b61a99d, "outputs");                                     // (@DataFlowConnector<Canvas> (mainCanvas).outputs) -- [IDataFlow<Canvas>] --> (MovingRender (id_4b39dde997d14570bd750e476b61a99d).mainCanvasInput)
            id_4b39dde997d14570bd750e476b61a99d.WireTo(id_5949b1f2856d46deb2148d18073dda8b, "lastPositionOutput"); // (MovingRender (id_4b39dde997d14570bd750e476b61a99d).lastPositionOutput) -- [IDataFlow<Point>] --> (MovingRender (id_5949b1f2856d46deb2148d18073dda8b).moveToPosition)
            mainCanvas.WireTo(id_5949b1f2856d46deb2148d18073dda8b, "outputs");                                     // (@DataFlowConnector<Canvas> (mainCanvas).outputs) -- [IDataFlow<Canvas>] --> (MovingRender (id_5949b1f2856d46deb2148d18073dda8b).mainCanvasInput)
            id_5949b1f2856d46deb2148d18073dda8b.WireTo(id_4858115ca72b43cbb978b92bef31c12d, "lastPositionOutput"); // (MovingRender (id_5949b1f2856d46deb2148d18073dda8b).lastPositionOutput) -- [IDataFlow<Point>] --> (MovingRender (id_4858115ca72b43cbb978b92bef31c12d).moveToPosition)
            mainCanvas.WireTo(id_4858115ca72b43cbb978b92bef31c12d, "outputs");                                     // (@DataFlowConnector<Canvas> (mainCanvas).outputs) -- [IDataFlow<Canvas>] --> (MovingRender (id_4858115ca72b43cbb978b92bef31c12d).mainCanvasInput)
            id_3babe233bb07413086c85807fcc6fff4.WireTo(gameTimer, "fanoutList");                                   // (EventConnector (id_3babe233bb07413086c85807fcc6fff4).fanoutList) -- [IEvent] --> (Timer (gameTimer).toggleStartStop)
            id_3babe233bb07413086c85807fcc6fff4.WireTo(id_14180dadcc5a42299b907ebbe26ecaa5, "fanoutList");         // (EventConnector (id_3babe233bb07413086c85807fcc6fff4).fanoutList) -- [IEvent] --> (Data<object> (id_14180dadcc5a42299b907ebbe26ecaa5).start)
            gameTimer.WireTo(moveSnake, "tickHappened");                                                           // (Timer (gameTimer).tickHappened) -- [IEvent] --> (Operation<object> (moveSnake).startOperation)
            moveSnake.WireTo(snakeDirection, "operands");                                                          // (Operation<object> (moveSnake).operands) -- [IDataFlowB<object>] --> (@DataFlowConnector<object> (snakeDirection).outputsB)
            moveSnake.WireTo(scalar, "operands");                                                                  // (Operation<object> (moveSnake).operands) -- [IDataFlowB<object>] --> (DataFlowConnector<object> (scalar).outputsB)
            moveSnake.WireTo(id_eee7d6d4227a44d096d1f1f1dbc62fee, "operationResultOutput");                        // (Operation<object> (moveSnake).operationResultOutput) -- [IDataFlow<object>] --> (Cast<object,Vector> (id_eee7d6d4227a44d096d1f1f1dbc62fee).input)
            id_eee7d6d4227a44d096d1f1f1dbc62fee.WireTo(snakeHead, "output");                                       // (Cast<object,Vector> (id_eee7d6d4227a44d096d1f1f1dbc62fee).output) -- [IDataFlow<Vector>] --> (MovingRender (snakeHead).offsetPosition)
            id_14180dadcc5a42299b907ebbe26ecaa5.WireTo(snakeDirection, "dataOutput");                              // (Data<object> (id_14180dadcc5a42299b907ebbe26ecaa5).dataOutput) -- [IDataFlow<object>] --> (DataFlowConnector<object> (snakeDirection).input)
            // END AUTO-GENERATED WIRING FOR SnakeALA.xmind

            // BEGIN MANUAL INSTANTIATIONS
            // END MANUAL INSTANTIATIONS

            // BEGIN MANUAL WIRING
            mainWindow.WireTo(new GameScreen());
            // END MANUAL WIRING
        }
Example #5
0
            public CalculatorNRows(out MainWindow mw)
            {
                // These Ratios and MinWidths are for the columns of the calculator
                // Label, Formula, TextBook, Result, Units, Description, Format, Digits
                int[] Ratios    = new int[] { 4, 8, 8, 8, 4, 8, 1 };
                int[] MinWidths = new int[] { 50, 100, 100, 100, 50, 50, 57 };  // 57 is just big enough to show the Fmt enum selections
                int   FontSize  = 25;

                // BEGIN AUTO-GENERATED INSTANTIATIONS FOR CalculatorNRows.xmind
                Button id_803db86064414b379608f65bc07098bc = new Button("Add row")
                {
                    InstanceName = "Default", FontSize = FontSize
                };
                CalculatorRowFactory id_012306911dbe485c91ecd24bd35b2420 = new CalculatorRowFactory()
                {
                    InstanceName = "Default"
                };
                DataFlowConnector <string> labelsConcatenatorConnector = new DataFlowConnector <string>()
                {
                    InstanceName = "labelsConcatenatorConnector"
                };
                Horizontal id_24914ab245484fe1b70af8020ca2e831 = new Horizontal()
                {
                    InstanceName = "Default", Ratios = Ratios, MinWidths = MinWidths
                };
                Horizontal id_aa2f23f75c79479e88ccf7ed0ed6c2cc = new Horizontal()
                {
                    InstanceName = "Default", Ratios = new int[] { 1, 8 }, MinWidths = new int[] { 50 }
                };
                MainWindow mainWindow = new MainWindow("Reactive Calculator")
                {
                    InstanceName = "mainWindow"
                };
                Multiple MultipleRow = new Multiple(N: 4)
                {
                    InstanceName = "MultipleRow", ConstructorCallbackMethod = (instance) => { ((CalculatorRow)instance).FontSize = FontSize;  ((CalculatorRow)instance).Ratios = Ratios;   ((CalculatorRow)instance).MinWidths = MinWidths; }, WiringMethod = (newInstance) => { _rows.WireTo(newInstance); _labelsConcatenator.WireTo(newInstance, "inputs");   newInstance.WireTo(labelsConcatenatorConnector, "labelsCommaSeparated");  testCalculatorRows.Add((ITestCalculatorRow)newInstance); }, CrossWiringMethod = (instance1, instance2) => { instance2.WireFrom(instance1, "operands"); }, PostWiringInitializeMethod = delegate(object instance) { _rows.AddRows();  ((CalculatorRow)instance).Initialize(); }
                };
                Space id_68d3e779ba0d4f78ad48db2ed468608c = new Space()
                {
                    InstanceName = "Default"
                };
                StringConcat labelsConcatenator = new StringConcat()
                {
                    InstanceName = "labelsConcatenator", Separator = ","
                };
                Text id_39a7a11c94da4b338a92b2235b8e96d1 = new Text("Units")
                {
                    InstanceName = "Default", FontSize = FontSize
                };
                Text id_6be1dbef5dd042ba88554b4482b16079 = new Text("Formula")
                {
                    InstanceName = "Default", FontSize = FontSize
                };
                Text id_93a237ff714b48748a4ba10ede42d2dc = new Text("Description")
                {
                    InstanceName = "Default", FontSize = FontSize
                };
                Text id_96b879e17b4346e4b98484224e65d582 = new Text("Label")
                {
                    InstanceName = "Default", FontSize = FontSize
                };
                Text id_a72464a6a1a8426887ca40b886b5567e = new Text("Textbook")
                {
                    InstanceName = "Default", FontSize = FontSize
                };
                Text id_ccc54bcd38e14c10a5ba59d851191cc4 = new Text("Result")
                {
                    InstanceName = "Default", FontSize = FontSize
                };
                Text id_f9b8d9329de5407b93a1834afeaf5de6 = new Text("Fmt")
                {
                    InstanceName = "Default", FontSize = FontSize
                };
                Text id_fc0b8f38b3c14f799f605cd54214b503 = new Text("Reactive Calculator")
                {
                    InstanceName = "Default", FontSize = FontSize
                };
                TextBox id_b84a8eee3a554afaad9fa90ac6b594f9 = new TextBox()
                {
                    InstanceName = "Default", Text = "Title your calculation here", FontSize = 15
                };
                Vertical id_b02d2caea938499b997b9bfcb80fb0e9 = new Vertical()
                {
                    InstanceName = "Default"
                };
                Vertical rows = new Vertical()
                {
                    InstanceName = "rows"
                };

                // END AUTO-GENERATED INSTANTIATIONS FOR CalculatorNRows.xmind

                // BEGIN AUTO-GENERATED WIRING FOR CalculatorNRows.xmind
                mainWindow.WireTo(id_b02d2caea938499b997b9bfcb80fb0e9, "iuiStructure");                      // (MainWindow (mainWindow).iuiStructure) -- [IUI] --> (Vertical (id_b02d2caea938499b997b9bfcb80fb0e9).child)
                labelsConcatenator.WireTo(labelsConcatenatorConnector, "output");                            // (StringConcat (labelsConcatenator).output) -- [iDataFlow<string>] --> (DataFlowConnector<string> (labelsConcatenatorConnector).input)
                id_b02d2caea938499b997b9bfcb80fb0e9.WireTo(id_fc0b8f38b3c14f799f605cd54214b503, "children"); // (Vertical (id_b02d2caea938499b997b9bfcb80fb0e9).children) -- [List<IUI>] --> (Text (id_fc0b8f38b3c14f799f605cd54214b503).child)
                id_b02d2caea938499b997b9bfcb80fb0e9.WireTo(id_b84a8eee3a554afaad9fa90ac6b594f9, "children"); // (Vertical (id_b02d2caea938499b997b9bfcb80fb0e9).children) -- [List<IUI>] --> (TextBox (id_b84a8eee3a554afaad9fa90ac6b594f9).child)
                id_b02d2caea938499b997b9bfcb80fb0e9.WireTo(id_24914ab245484fe1b70af8020ca2e831, "children"); // (Vertical (id_b02d2caea938499b997b9bfcb80fb0e9).children) -- [List<IUI>] --> (Horizontal (id_24914ab245484fe1b70af8020ca2e831).child)
                id_b02d2caea938499b997b9bfcb80fb0e9.WireTo(rows, "children");                                // (Vertical (id_b02d2caea938499b997b9bfcb80fb0e9).children) -- [List<IUI>] --> (Vertical (rows).Child)
                id_b02d2caea938499b997b9bfcb80fb0e9.WireTo(id_aa2f23f75c79479e88ccf7ed0ed6c2cc, "children"); // (Vertical (id_b02d2caea938499b997b9bfcb80fb0e9).children) -- [List<IUI>] --> (Horizontal (id_aa2f23f75c79479e88ccf7ed0ed6c2cc).Child)
                id_24914ab245484fe1b70af8020ca2e831.WireTo(id_96b879e17b4346e4b98484224e65d582, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_96b879e17b4346e4b98484224e65d582).child)
                id_24914ab245484fe1b70af8020ca2e831.WireTo(id_6be1dbef5dd042ba88554b4482b16079, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_6be1dbef5dd042ba88554b4482b16079).child)
                id_24914ab245484fe1b70af8020ca2e831.WireTo(id_a72464a6a1a8426887ca40b886b5567e, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_a72464a6a1a8426887ca40b886b5567e).child)
                id_24914ab245484fe1b70af8020ca2e831.WireTo(id_ccc54bcd38e14c10a5ba59d851191cc4, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_ccc54bcd38e14c10a5ba59d851191cc4).child)
                id_24914ab245484fe1b70af8020ca2e831.WireTo(id_39a7a11c94da4b338a92b2235b8e96d1, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_39a7a11c94da4b338a92b2235b8e96d1).child)
                id_24914ab245484fe1b70af8020ca2e831.WireTo(id_93a237ff714b48748a4ba10ede42d2dc, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_93a237ff714b48748a4ba10ede42d2dc).child)
                id_24914ab245484fe1b70af8020ca2e831.WireTo(id_f9b8d9329de5407b93a1834afeaf5de6, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_f9b8d9329de5407b93a1834afeaf5de6).child)
                id_aa2f23f75c79479e88ccf7ed0ed6c2cc.WireTo(id_803db86064414b379608f65bc07098bc, "children"); // (Horizontal (id_aa2f23f75c79479e88ccf7ed0ed6c2cc).children) -- [List<IUI>] --> (Button (id_803db86064414b379608f65bc07098bc).child)
                id_aa2f23f75c79479e88ccf7ed0ed6c2cc.WireTo(id_68d3e779ba0d4f78ad48db2ed468608c, "children"); // (Horizontal (id_aa2f23f75c79479e88ccf7ed0ed6c2cc).children) -- [List<IUI>] --> (Space (id_68d3e779ba0d4f78ad48db2ed468608c).child)
                id_803db86064414b379608f65bc07098bc.WireTo(MultipleRow, "eventButtonClicked");               // (Button (id_803db86064414b379608f65bc07098bc).eventButtonClicked) -- [IEvent] --> (Multiple (MultipleRow).addRow)
                MultipleRow.WireTo(id_012306911dbe485c91ecd24bd35b2420, "factory");                          // (Multiple (MultipleRow).factory) -- [IFactoryMethod] --> (CalculatorRowFactory (id_012306911dbe485c91ecd24bd35b2420).factory)
                // END AUTO-GENERATED WIRING FOR CalculatorNRows.xmind

                // These are used to solve compiler error "Cannot use local variable 'rows' before it is declared" in the lambda functions in the wiring code above if they reference 'rows' and 'labelsConcetenator' instead;
                _rows = rows;
                _labelsConcatenator = labelsConcatenator;  //

                // This tell MultipleRow object to go ahead an create calculator rows (each of which will use the lambdas above to wire into the rest of the application)
                MultipleRow.Generate();


                // these are used for testing the application to set the title and press the button
                title        = id_b84a8eee3a554afaad9fa90ac6b594f9;
                addRowButton = id_803db86064414b379608f65bc07098bc;

                mw = mainWindow;
            }
Example #6
0
        private MainWindow Calculator2ARows()
        {
            var mainWindow = new MainWindow("Calculator");
            // BEGIN AUTO-GENERATED INSTANTIATIONS FOR Calculator2ARows.xmind
            CalculatorRow Row1 = new CalculatorRow()
            {
                InstanceName = "Row1"
            };
            CalculatorRow Row2 = new CalculatorRow()
            {
                InstanceName = "Row2"
            };
            DataFlowConnector <string> labelsConcatenatorConnector = new DataFlowConnector <string>()
            {
                InstanceName = "labelsConcatenatorConnector"
            };
            Horizontal id_24914ab245484fe1b70af8020ca2e831 = new Horizontal()
            {
                InstanceName = "Default", Ratios = new int[] { 1, 2, 2, 1, 3 }, MinWidths = new int[] { 50, 200, 520 }
            };
            StringConcat labelsConcatenator = new StringConcat()
            {
                InstanceName = "labelsConcatenator", Separator = ","
            };
            Text id_39a7a11c94da4b338a92b2235b8e96d1 = new Text("Units")
            {
                InstanceName = "Default", FontSize = 50
            };
            Text id_6be1dbef5dd042ba88554b4482b16079 = new Text("Formula")
            {
                InstanceName = "Default", FontSize = 50
            };
            Text id_93a237ff714b48748a4ba10ede42d2dc = new Text("Description")
            {
                InstanceName = "Default", FontSize = 50
            };
            Text id_96b879e17b4346e4b98484224e65d582 = new Text("Label")
            {
                InstanceName = "Default", FontSize = 50
            };
            Text id_ccc54bcd38e14c10a5ba59d851191cc4 = new Text("Result")
            {
                InstanceName = "Default", FontSize = 50
            };
            Text id_fc0b8f38b3c14f799f605cd54214b503 = new Text("Debug output")
            {
                InstanceName = "Default", FontSize = 50
            };
            Vertical rows = new Vertical()
            {
                InstanceName = "rows"
            };

            // END AUTO-GENERATED INSTANTIATIONS FOR Calculator2ARows.xmind

            // BEGIN AUTO-GENERATED WIRING FOR Calculator2ARows.xmind
            mainWindow.WireTo(rows, "iuiStructure");                                                     // (@MainWindow (mainWindow).iuiStructure) -- [IUI] --> (Vertical (rows).child)
            rows.WireTo(id_24914ab245484fe1b70af8020ca2e831, "children");                                // (Vertical (rows).children) -- [List<IUI>] --> (Horizontal (id_24914ab245484fe1b70af8020ca2e831).child)
            rows.WireTo(Row1, "children");                                                               // (Vertical (rows).children) -- [List<IUI>] --> (CalculatorRow (Row1).child)
            rows.WireTo(Row2, "children");                                                               // (Vertical (rows).children) -- [List<IUI>] --> (CalculatorRow (Row2).child)
            rows.WireTo(id_fc0b8f38b3c14f799f605cd54214b503, "children");                                // (Vertical (rows).children) -- [List<IUI>] --> (Text (id_fc0b8f38b3c14f799f605cd54214b503).child)
            id_24914ab245484fe1b70af8020ca2e831.WireTo(id_96b879e17b4346e4b98484224e65d582, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_96b879e17b4346e4b98484224e65d582).child)
            id_24914ab245484fe1b70af8020ca2e831.WireTo(id_6be1dbef5dd042ba88554b4482b16079, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_6be1dbef5dd042ba88554b4482b16079).child)
            id_24914ab245484fe1b70af8020ca2e831.WireTo(id_ccc54bcd38e14c10a5ba59d851191cc4, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_ccc54bcd38e14c10a5ba59d851191cc4).child)
            id_24914ab245484fe1b70af8020ca2e831.WireTo(id_39a7a11c94da4b338a92b2235b8e96d1, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_39a7a11c94da4b338a92b2235b8e96d1).child)
            id_24914ab245484fe1b70af8020ca2e831.WireTo(id_93a237ff714b48748a4ba10ede42d2dc, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_93a237ff714b48748a4ba10ede42d2dc).child)
            labelsConcatenator.WireTo(Row1, "inputs");                                                   // (StringConcat (labelsConcatenator).inputs) -- [IDataFlowB<string>] --> (CalculatorRow (Row1).label)
            Row2.WireTo(Row1, "operands");                                                               // (CalculatorRow (Row2).operands) -- [IDataFlowB<double>] --> (CalculatorRow (Row1).result)
            Row1.WireTo(Row1, "operands");                                                               // (CalculatorRow (Row1).operands) -- [IDataFlowB<double>] --> (CalculatorRow (Row1).result)
            labelsConcatenator.WireTo(Row2, "inputs");                                                   // (StringConcat (labelsConcatenator).inputs) -- [IDataFlowB<string>] --> (CalculatorRow (Row2).label)
            Row2.WireTo(Row2, "operands");                                                               // (CalculatorRow (Row2).operands) -- [IDataFlowB<double>] --> (CalculatorRow (Row2).result)
            Row1.WireTo(Row2, "operands");                                                               // (CalculatorRow (Row1).operands) -- [IDataFlowB<double>] --> (CalculatorRow (Row2).result)
            labelsConcatenator.WireTo(labelsConcatenatorConnector, "output");                            // (StringConcat (labelsConcatenator).output) -- [iDataFlow<string>] --> (DataFlowConnector<string> (labelsConcatenatorConnector).input)
            Row2.WireTo(labelsConcatenatorConnector, "labelsCommaSeparated");                            // (CalculatorRow (Row2).labelsCommaSeparated) -- [IDataFlowB<string>] --> (DataFlowConnector<string> (labelsConcatenatorConnector).outputsB)
            Row1.WireTo(labelsConcatenatorConnector, "labelsCommaSeparated");                            // (CalculatorRow (Row1).labelsCommaSeparated) -- [IDataFlowB<string>] --> (DataFlowConnector<string> (labelsConcatenatorConnector).outputsB)
            // END AUTO-GENERATED WIRING FOR Calculator2ARows.xmind
            // Row1.WireInternals();
            // Row2.WireInternals();
            return(mainWindow);
        }
Example #7
0
        /*
         *
         *      public void CalculatorNRows()
         *      {
         *          Vertical rows = new Vertical() { InstanceName = "rows" };
         *          StringConcat labelsConcatenator = new StringConcat() { InstanceName = "labelsConcatenator", Separator = "," };
         *          // BEGIN AUTO-GENERATED INSTANTIATIONS FOR CalculatorNRows2.xmind
         *          Button id_803db86064414b379608f65bc07098bc = new Button("Add row") { InstanceName = "Default", FontSize = 25 };
         *          CalculatorRowFactory id_012306911dbe485c91ecd24bd35b2420 = new CalculatorRowFactory() { InstanceName = "Default" };
         *          DataFlowConnector<string> labelsConcatenatorConnector = new DataFlowConnector<string>() { InstanceName = "labelsConcatenatorConnector" };
         *          Horizontal id_24914ab245484fe1b70af8020ca2e831 = new Horizontal() { InstanceName = "Default", Ratios = new int[] { 1, 2, 2, 1, 3 }, MinWidths = new int[] { 50, 200, 520 } };
         *          Horizontal id_aa2f23f75c79479e88ccf7ed0ed6c2cc = new Horizontal() { InstanceName = "Default", Ratios = new int[] { 1, 8 }, MinWidths = new int[] { 50 } };
         *          Multiple MultipleRow = new Multiple(N: 4) { InstanceName = "MultipleRow", WiringMethod = (newInstance) => { rows.WireTo(newInstance); labelsConcatenator.WireTo(newInstance, "inputs"); newInstance.WireTo(labelsConcatenatorConnector, "labelsCommaSeparated"); }, CrossWiringMethod = (instance1, instance2) => { instance2.WireFrom(instance1, "operands"); }, PostWiringInitializeMethod = delegate (object instance) { rows.AddRows(); ((CalculatorRow)instance).Initialize(); } };
         *          Space id_68d3e779ba0d4f78ad48db2ed468608c = new Space() { InstanceName = "Default" };
         *          Text id_39a7a11c94da4b338a92b2235b8e96d1 = new Text("Units") { InstanceName = "Default", FontSize = 25 };
         *          Text id_6be1dbef5dd042ba88554b4482b16079 = new Text("Formula") { InstanceName = "Default", FontSize = 25 };
         *          Text id_93a237ff714b48748a4ba10ede42d2dc = new Text("Description") { InstanceName = "Default", FontSize = 25 };
         *          Text id_96b879e17b4346e4b98484224e65d582 = new Text("Label") { InstanceName = "Default", FontSize = 25 };
         *          Text id_ccc54bcd38e14c10a5ba59d851191cc4 = new Text("Result") { InstanceName = "Default", FontSize = 25 };
         *          Text id_fc0b8f38b3c14f799f605cd54214b503 = new Text("Reactive Calculator") { InstanceName = "Default", FontSize = 25 };
         *          TextBox id_b84a8eee3a554afaad9fa90ac6b594f9 = new TextBox() { InstanceName = "Default", Text = "Title your calculation here", FontSize = 15 };
         *          Vertical id_b02d2caea938499b997b9bfcb80fb0e9 = new Vertical() { InstanceName = "Default" };
         *          // END AUTO-GENERATED INSTANTIATIONS FOR CalculatorNRows2.xmind
         *          // ((CalculatorRow)newInstance).WireInternals();
         *
         *          // BEGIN AUTO-GENERATED WIRING FOR CalculatorNRows2.xmind
         *          mainWindow.WireTo(id_b02d2caea938499b997b9bfcb80fb0e9, "iuiStructure"); // (@MainWindow (mainWindow).iuiStructure) -- [IUI] --> (Vertical (id_b02d2caea938499b997b9bfcb80fb0e9).child)
         *          labelsConcatenator.WireTo(labelsConcatenatorConnector, "output"); // (@StringConcat (labelsConcatenator).output) -- [iDataFlow<string>] --> (DataFlowConnector<string> (labelsConcatenatorConnector).input)
         *          id_b02d2caea938499b997b9bfcb80fb0e9.WireTo(id_fc0b8f38b3c14f799f605cd54214b503, "children"); // (Vertical (id_b02d2caea938499b997b9bfcb80fb0e9).children) -- [List<IUI>] --> (Text (id_fc0b8f38b3c14f799f605cd54214b503).child)
         *          id_b02d2caea938499b997b9bfcb80fb0e9.WireTo(id_b84a8eee3a554afaad9fa90ac6b594f9, "children"); // (Vertical (id_b02d2caea938499b997b9bfcb80fb0e9).children) -- [List<IUI>] --> (TextBox (id_b84a8eee3a554afaad9fa90ac6b594f9).child)
         *          id_b02d2caea938499b997b9bfcb80fb0e9.WireTo(id_24914ab245484fe1b70af8020ca2e831, "children"); // (Vertical (id_b02d2caea938499b997b9bfcb80fb0e9).children) -- [List<IUI>] --> (Horizontal (id_24914ab245484fe1b70af8020ca2e831).child)
         *          id_b02d2caea938499b997b9bfcb80fb0e9.WireTo(rows, "children"); // (Vertical (id_b02d2caea938499b997b9bfcb80fb0e9).children) -- [List<IUI>] --> (@Vertical (rows).Child)
         *          id_b02d2caea938499b997b9bfcb80fb0e9.WireTo(id_aa2f23f75c79479e88ccf7ed0ed6c2cc, "children"); // (Vertical (id_b02d2caea938499b997b9bfcb80fb0e9).children) -- [List<IUI>] --> (Horizontal (id_aa2f23f75c79479e88ccf7ed0ed6c2cc).Child)
         *          id_24914ab245484fe1b70af8020ca2e831.WireTo(id_96b879e17b4346e4b98484224e65d582, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_96b879e17b4346e4b98484224e65d582).child)
         *          id_24914ab245484fe1b70af8020ca2e831.WireTo(id_6be1dbef5dd042ba88554b4482b16079, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_6be1dbef5dd042ba88554b4482b16079).child)
         *          id_24914ab245484fe1b70af8020ca2e831.WireTo(id_ccc54bcd38e14c10a5ba59d851191cc4, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_ccc54bcd38e14c10a5ba59d851191cc4).child)
         *          id_24914ab245484fe1b70af8020ca2e831.WireTo(id_39a7a11c94da4b338a92b2235b8e96d1, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_39a7a11c94da4b338a92b2235b8e96d1).child)
         *          id_24914ab245484fe1b70af8020ca2e831.WireTo(id_93a237ff714b48748a4ba10ede42d2dc, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_93a237ff714b48748a4ba10ede42d2dc).child)
         *          id_aa2f23f75c79479e88ccf7ed0ed6c2cc.WireTo(id_803db86064414b379608f65bc07098bc, "children"); // (Horizontal (id_aa2f23f75c79479e88ccf7ed0ed6c2cc).children) -- [List<IUI>] --> (Button (id_803db86064414b379608f65bc07098bc).child)
         *          id_aa2f23f75c79479e88ccf7ed0ed6c2cc.WireTo(id_68d3e779ba0d4f78ad48db2ed468608c, "children"); // (Horizontal (id_aa2f23f75c79479e88ccf7ed0ed6c2cc).children) -- [List<IUI>] --> (Space (id_68d3e779ba0d4f78ad48db2ed468608c).child)
         *          id_803db86064414b379608f65bc07098bc.WireTo(MultipleRow, "eventButtonClicked"); // (Button (id_803db86064414b379608f65bc07098bc).eventButtonClicked) -- [IEvent] --> (Multiple (MultipleRow).addRow)
         *          MultipleRow.WireTo(id_012306911dbe485c91ecd24bd35b2420, "factory"); // (Multiple (MultipleRow).factory) -- [IFactoryMethod] --> (CalculatorRowFactory (id_012306911dbe485c91ecd24bd35b2420).factory)
         *          // END AUTO-GENERATED WIRING FOR CalculatorNRows2.xmind
         *          MultipleRow.Generate();
         *      }
         */



        private MainWindow Calculator10Rows()
        {
            MainWindow mainWindow = new MainWindow("Calculator");
            Vertical   rows       = new Vertical()
            {
                InstanceName = "rows"
            };
            StringConcat labelsConcatenator = new StringConcat()
            {
                InstanceName = "labelsConcatenator", Separator = ","
            };
            // BEGIN AUTO-GENERATED INSTANTIATIONS FOR Calculator10Rows.xmind
            CalculatorRowFactory id_012306911dbe485c91ecd24bd35b2420 = new CalculatorRowFactory()
            {
                InstanceName = "Default"
            };
            DataFlowConnector <string> labelsConcatenatorConnector = new DataFlowConnector <string>()
            {
                InstanceName = "labelsConcatenatorConnector"
            };
            Horizontal id_24914ab245484fe1b70af8020ca2e831 = new Horizontal()
            {
                InstanceName = "Default", Ratios = new int[] { 1, 2, 2, 1, 3 }, MinWidths = new int[] { 50, 200, 520 }
            };
            Multiple MultipleRow = new Multiple(N: 10)
            {
                InstanceName = "MultipleRow", WiringMethod = (newInstance) => { rows.WireTo(newInstance); labelsConcatenator.WireTo(newInstance, "inputs"); newInstance.WireTo(labelsConcatenatorConnector, "labelsCommaSeparated"); }, CrossWiringMethod = (instance1, instance2) => { instance2.WireFrom(instance1, "operands"); }
            };
            Text id_39a7a11c94da4b338a92b2235b8e96d1 = new Text("Units")
            {
                InstanceName = "Default", FontSize = 25
            };
            Text id_6be1dbef5dd042ba88554b4482b16079 = new Text("Formula")
            {
                InstanceName = "Default", FontSize = 25
            };
            Text id_93a237ff714b48748a4ba10ede42d2dc = new Text("Description")
            {
                InstanceName = "Default", FontSize = 25
            };
            Text id_96b879e17b4346e4b98484224e65d582 = new Text("Label")
            {
                InstanceName = "Default", FontSize = 25
            };
            Text id_ccc54bcd38e14c10a5ba59d851191cc4 = new Text("Result")
            {
                InstanceName = "Default", FontSize = 25
            };
            Text id_fc0b8f38b3c14f799f605cd54214b503 = new Text("Reactive Calculator")
            {
                InstanceName = "Default", FontSize = 25
            };
            TextBox id_b84a8eee3a554afaad9fa90ac6b594f9 = new TextBox()
            {
                InstanceName = "Default", Text = "Title your calculation here", FontSize = 15
            };

            // END AUTO-GENERATED INSTANTIATIONS FOR Calculator10Rows.xmind

            // BEGIN AUTO-GENERATED WIRING FOR Calculator10Rows.xmind
            mainWindow.WireTo(rows, "iuiStructure");                                                     // (@MainWindow (mainWindow).iuiStructure) -- [IUI] --> (@Vertical (rows).child)
            labelsConcatenator.WireTo(labelsConcatenatorConnector, "output");                            // (@StringConcat (labelsConcatenator).output) -- [iDataFlow<string>] --> (DataFlowConnector<string> (labelsConcatenatorConnector).input)
            rows.WireTo(id_fc0b8f38b3c14f799f605cd54214b503, "children");                                // (@Vertical (rows).children) -- [List<IUI>] --> (Text (id_fc0b8f38b3c14f799f605cd54214b503).child)
            rows.WireTo(id_b84a8eee3a554afaad9fa90ac6b594f9, "children");                                // (@Vertical (rows).children) -- [List<IUI>] --> (TextBox (id_b84a8eee3a554afaad9fa90ac6b594f9).child)
            rows.WireTo(id_24914ab245484fe1b70af8020ca2e831, "children");                                // (@Vertical (rows).children) -- [List<IUI>] --> (Horizontal (id_24914ab245484fe1b70af8020ca2e831).child)
            id_24914ab245484fe1b70af8020ca2e831.WireTo(id_96b879e17b4346e4b98484224e65d582, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_96b879e17b4346e4b98484224e65d582).child)
            id_24914ab245484fe1b70af8020ca2e831.WireTo(id_6be1dbef5dd042ba88554b4482b16079, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_6be1dbef5dd042ba88554b4482b16079).child)
            id_24914ab245484fe1b70af8020ca2e831.WireTo(id_ccc54bcd38e14c10a5ba59d851191cc4, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_ccc54bcd38e14c10a5ba59d851191cc4).child)
            id_24914ab245484fe1b70af8020ca2e831.WireTo(id_39a7a11c94da4b338a92b2235b8e96d1, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_39a7a11c94da4b338a92b2235b8e96d1).child)
            id_24914ab245484fe1b70af8020ca2e831.WireTo(id_93a237ff714b48748a4ba10ede42d2dc, "children"); // (Horizontal (id_24914ab245484fe1b70af8020ca2e831).children) -- [List<IUI>] --> (Text (id_93a237ff714b48748a4ba10ede42d2dc).child)
            MultipleRow.WireTo(id_012306911dbe485c91ecd24bd35b2420, "factory");                          // (Multiple (MultipleRow).factory) -- [IFactoryMethod] --> (CalculatorRowFactory (id_012306911dbe485c91ecd24bd35b2420).factory)
            // END AUTO-GENERATED WIRING FOR Calculator10Rows.xmind
            MultipleRow.Generate();
            return(mainWindow);
        }