Esempio n. 1
0
        // Right Group
        private Control prepareRightGroup()
        {
            var group = new GroupBox();

            // Create the controls
            MyStateInfoTextArea        = new StateInfoTextArea();
            MyStateInfoTextArea.Height = 286;
            MyStateInfoTextArea.Width  = 200;

            // Add controls to layout
            var layout = new TableLayout
            {
                Spacing = new Size(5, 5),
                Padding = new Padding(10),
                //Width = 800,
                Rows =
                {
                    new Label {
                        Text = "STATE INFORMATION"
                    },
                    new TableRow(MyStateInfoTextArea)
                    {
                        ScaleHeight = true
                    }
                }
            };

            // Add layout to group and return
            group.Content = layout;
            return(group);
        }
Esempio n. 2
0
        // Simulation Controls
        // Includes 2 text areas for logging
        // Will include controls for the simulation once those have been decided on
        private Control prepareSimulationControlGroup()
        {
            var group = new GroupBox {
                Text = "Simulation Control"
            };

            MyStateInfoTextArea   = new StateInfoTextArea();
            MyNetworkInfoTextArea = new NetworkInfoTextArea();

            PlayPauseButton = new Button {
                Text = "PLAY/PAUSE", Height = 30
            };
            GodModeButton = new Button {
                Text = "GODMODE", Height = 30
            };

            var rightLayout = new TableLayout
            {
                Spacing = new Size(5, 5),
                Padding = new Padding(0),
                Width   = 400,
                Rows    =
                {
                    new TableRow(new TableCell(MyNetworkInfoTextArea,        false))
                    {
                        ScaleHeight = true
                    },
                    new TableRow(new TableRow(new TableCell(PlayPauseButton, true), new TableCell(GodModeButton, true))
                    {
                        ScaleHeight = false
                    })
                }
            };


            var layout = new TableLayout
            {
                Spacing = new Size(5, 5),
                Padding = new Padding(10),
                Width   = 800,
                Rows    =
                {
                    new TableRow(
                        new TableCell(MyStateInfoTextArea, true), rightLayout
                        )
                }
            };

            group.Content = layout;
            return(group);
        }
Esempio n. 3
0
        // Simulation Controls
        // Includes 2 text areas for logging
        // Will include controls for the simulation once those have been decided on
        private Control prepareSimulationControlGroup()
        {
            var group = new GroupBox {
                Text = "Simulation Control"
            };

            MyStateInfoTextArea   = new StateInfoTextArea();
            MyNetworkInfoTextArea = new NetworkInfoTextArea();

            string hostName = Dns.GetHostName();
            var    host     = Dns.GetHostEntry(hostName);
            string myIP     = "";

            foreach (IPAddress ip in host.AddressList)
            {
                if (ip.AddressFamily != System.Net.Sockets.AddressFamily.InterNetworkV6)
                {
                    myIP = myIP + "\t" + ip.ToString();
                }
            }

            MyNetworkInfoTextArea.IP = myIP;

            PlayPauseButton = new Button {
                Text = "PLAY/PAUSE", Height = 30
            };
            GodModeButton = new Button {
                Text = "GODMODE", Height = 30
            };

            PlayPauseButton.Click += PlayPause_Click;

            var rightLayout = new TableLayout
            {
                Spacing = new Size(5, 5),
                Padding = new Padding(0),
                Width   = 400,
                Rows    =
                {
                    new TableRow(new TableCell(MyNetworkInfoTextArea,        false))
                    {
                        ScaleHeight = true
                    },
                    new TableRow(new TableRow(new TableCell(PlayPauseButton, true), new TableCell(GodModeButton, true))
                    {
                        ScaleHeight = false
                    })
                }
            };


            var layout = new TableLayout
            {
                Spacing = new Size(5, 5),
                Padding = new Padding(10),
                Width   = 800,
                Rows    =
                {
                    new TableRow(
                        new TableCell(MyStateInfoTextArea, true), rightLayout
                        )
                }
            };

            group.Content = layout;
            return(group);
        }