Exemple #1
0
        /// <summary>
        /// User has selected to clear the city list.
        /// Not allowed if running the TSP algorithm.
        /// </summary>
        /// <param name="sender">Object that generated this event.</param>
        /// <param name="e">Event arguments.</param>
        private void clearCityListButton_Click(object sender, EventArgs e)
        {
            int i = 0;

            if (tsp != null)
            {
                StatusLabel.Text      = "Невозможно добавить город во время работы";
                StatusLabel.ForeColor = Color.Red;
                return;
            }
            foreach (PictureBox pBox in listcity)
            {
                tourDiagram.Controls.Remove(listcity[i]);
                i++;
                tourDiagram.Update();
            }

            cityList.Clear();
            this.DrawCityList(cityList);

            // writeFileName = this.fileNameTextBox.Text;
            cityImage    = new Bitmap(tourDiagram.Width, tourDiagram.Height);
            cityGraphics = Graphics.FromImage(cityImage);

            cityGraphics.FillRectangle(Brushes.White, 0, 0, cityImage.Width, cityImage.Height);
            this.tourDiagram.Image = cityImage;
            inc = 1;
            mLoc_x.Clear();
            mLoc_y.Clear();
            mRLoc_x.Clear();
            mRLoc_y.Clear();
        }
Exemple #2
0
        /// User has selected to clear the city list.
        /// Not allowed if running the TSP algorithm.
        private void clearCityListButton_Click(object sender, EventArgs e)
        {
            if (tsp != null)
            {
                StatusLabel.Text      = "Cannot alter city list while running";
                StatusLabel.ForeColor = Color.Red;
                return;
            }

            cityList.Clear();
            this.DrawCityList(cityList);
        }
        /// <summary>
        /// User has selected to clear the city list.
        /// Not allowed if running the TSP algorithm.
        /// </summary>
        /// <param name="sender">Object that generated this event.</param>
        /// <param name="e">Event arguments.</param>
        private void clearCityListButton_Click(object sender, EventArgs e)
        {
            if (tsp != null)
            {
                StatusLabel.Text      = "Невозможно добавить город во время работы";
                StatusLabel.ForeColor = Color.Red;
                return;
            }

            cityList.Clear();
            this.DrawCityList(cityList);
        }
Exemple #4
0
        /// <summary>
        /// User has selected to clear the city list.
        /// Not allowed if running the TSP algorithm.
        /// </summary>
        /// <param name="sender">Object that generated this event.</param>
        /// <param name="e">Event arguments.</param>
        private void clearCityListButton_Click(object sender, EventArgs e)
        {
            if (tsp != null)
            {
                StatusLabel.Text      = "Нельзя изменить список городов во время работы программы.";
                StatusLabel.ForeColor = Color.Red;
                return;
            }

            cityList.Clear();
            this.DrawCityList(cityList);
        }