Esempio n. 1
0
        public BuildingDetails(BuildingLevel buildingLevel, BuildingDetailController controller)
        {
            this.buildingLevel = buildingLevel;
            this.controller = controller;

            controller.view = this;

            InitializeComponent();
        }
Esempio n. 2
0
        private void dataGridView3_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 7)
            {
                var controller = new BuildingDetailController();
                var form = new BuildingDetails(buildings.ElementAt(e.RowIndex), controller);

                form.Show();
            }
            else if (e.ColumnIndex == 6)
            {
                startBuilding(e.RowIndex);
            }
            else if (e.ColumnIndex == 9)
            {
                if (e.RowIndex == currentRow)
                {

                    DialogResult dialog = MessageBox.Show("Do you want to cancle build", "Yes", MessageBoxButtons.YesNo);

                    if (dialog == DialogResult.Yes)
                    {
                        cancleBuild();
                    }
                }
                else
                {
                    MessageBox.Show("Selected building not being built. To cancle select correct row");
                }
            }
        }