Close() private method

private Close ( ) : void
return void
        private void btnBrisanje_Click(object sender, EventArgs e)
        {
            Control activeForm = this.FindForm();
            Point   location   = new Point(((Form1)activeForm).Location.X + 2, ((Form1)activeForm).Location.Y + 25);

            back = new Background();
            back.Show();
            back.Location = location;
            DeleteWarning deleteWarning = new DeleteWarning("Da li ste sigurni da hoćete da obrišete " + dgvSportisti.SelectedCells[2].Value.ToString() + " " + dgvSportisti.SelectedCells[1].Value.ToString() + "?");


            if (deleteWarning.ShowDialog() == DialogResult.Yes)
            {
                Sportiste_Collection.getInstance.Sportiste_collection.Remove(new Guid(dgvSportisti.SelectedCells[0].Value.ToString()));
                List <Guid> sportistiUTimu = new List <Guid>();

                foreach (KeyValuePair <Guid, Tim> tim in Timovi_Collection.getInstance.Timovi_collection)
                {
                    if (tim.Value.Sportiste != null)
                    {
                        foreach (KeyValuePair <Guid, Sportista> sportista in tim.Value.Sportiste)
                        {
                            if (dgvSportisti.SelectedCells[0].Value.ToString().Equals(sportista.Key.ToString()))
                            {
                                sportistiUTimu.Add(sportista.Key);
                            }
                        }
                        foreach (Guid temp in sportistiUTimu)
                        {
                            Timovi_Collection.getInstance.Timovi_collection[tim.Key].Sportiste.Remove(temp);
                        }
                    }
                }

                loadTableData("");

                back.Close();
            }
            else
            {
                back.Close();
            }
        }
Esempio n. 2
0
 private void CloseBackground(Action onClosed = null)
 {
     if (Background != null)
     {
         Background.Close(onClosed.SafeInvoke);
     }
     else
     {
         onClosed.SafeInvoke();
     }
 }
Esempio n. 3
0
 private void CloseBackground(Action onClosed = null)
 {
     if (Background != null)
     {
         Background.Close(() => onClosed?.Invoke());
     }
     else
     {
         onClosed?.Invoke();
     }
 }
        private void btnBrisanje_Click(object sender, EventArgs e)
        {
            Control activeForm = this.FindForm();
            Point   location   = new Point(((Form1)activeForm).Location.X + 2, ((Form1)activeForm).Location.Y + 25);

            back = new Background();
            back.Show();
            back.Location = location;
            DeleteWarning deleteWarning = new DeleteWarning("Da li ste sigurni da hoćete da obrišete " + dgvTimovi.SelectedCells[1].Value.ToString() + "?");

            if (deleteWarning.ShowDialog() == DialogResult.Yes)
            {
                Timovi_Collection.getInstance.Timovi_collection.Remove(new Guid(dgvTimovi.SelectedCells[0].Value.ToString()));
                loadTableData("");
                back.Close();
            }
            else
            {
                back.Close();
            }
        }
Esempio n. 5
0
        public void Process(object sender, CapturedScreenshotEventArgs image)
        {
            _background.Visibility = Visibility.Visible;
            _background.SetDimensions(_x, _y, _width, _height);

            _background.ContentRendered += (s, e) =>
            {
                OnFiltered(null);

                _background.Close();
                _background = null;
            };
        }
Esempio n. 6
0
        private void btnBrisanje_Click(object sender, EventArgs e)
        {
            bool  brisanje      = true;
            Teren trenutniTeren = new Teren(null, null, null, false, null, -1, null);

            Tereni_Collection.getInstance.Teren_collection.TryGetValue(new Guid(dgvTereni.SelectedCells[0].Value.ToString()), out trenutniTeren);

            foreach (KeyValuePair <Guid, Hala> hala in Hale_Collection.getInstance.Hale_collection)
            {
                if (hala.Value.ImeHale.ToString().Equals(trenutniTeren.Lokacija.ImeHale.ToString()))
                {
                    System.Diagnostics.Debug.WriteLine(hala.Value.BrTerena);
                    if (hala.Value.BrTerena < 2)
                    {
                        brisanje = false;
                    }
                }
            }

            if (brisanje)
            {
                Control activeForm = this.FindForm();
                Point   location   = new Point(((Form1)activeForm).Location.X + 2, ((Form1)activeForm).Location.Y + 25);
                back = new Background();
                back.Show();
                back.Location = location;
                DeleteWarning deleteWarning = new DeleteWarning("Da li ste sigurni da hoćete da obrišete " + dgvTereni.SelectedCells[1].Value.ToString() + "?");
                if (deleteWarning.ShowDialog() == DialogResult.Yes)
                {
                    Guid trenutnaHala = new Guid();
                    foreach (KeyValuePair <Guid, Hala> hala in Hale_Collection.getInstance.Hale_collection)
                    {
                        if (hala.Value.ImeHale.ToString().Equals(dgvTereni.SelectedCells[2].Value.ToString()))
                        {
                            trenutnaHala = hala.Key;
                        }
                    }

                    Hale_Collection.getInstance.Hale_collection[trenutnaHala].BrTerena--;

                    Tereni_Collection.getInstance.Teren_collection.Remove(new Guid(dgvTereni.SelectedCells[0].Value.ToString()));
                    loadTableData("");
                    back.Close();
                }
                else
                {
                    back.Close();
                }
            }
            else
            {
                Point      location = new Point(Form1.getInstance.Location.X + 2, Form1.getInstance.Location.Y + 25);
                Background back     = new Background();
                back.Location = location;
                back.Show();
                MaxTerenWarning mtw = new MaxTerenWarning(dgvTereni.SelectedCells[1].Value.ToString() + " je poslednji teren u hali" + dgvTereni.SelectedCells[2].Value.ToString() + " !");
                if (mtw.ShowDialog() == DialogResult.OK)
                {
                    back.Hide();
                }
            }
            brisanje = true;
        }
Esempio n. 7
0
 public void OnDestroy()
 {
     background.Close();
     menuPanel.Close();
     pages[pageIndex].Close();
 }