예제 #1
0
        /// <summary>
        /// オブジェクトコンポーネント開放メソッド
        /// </summary>
        public void ReleaseComponent()
        {
            //confirmForm.Close();
            gofdisplayForm.Close();

            //確認用ディスプレイ開放
            if (confirmForm != null)
            {
                confirmForm.Close();
            }
            if (confirmChart != null)
            {
                confirmChart.Dispose();
            }
            if (confirmChartArea != null)
            {
                confirmChartArea.Dispose();
            }
            if (confirmLegend != null)
            {
                confirmLegend.Dispose();
            }
            if (confirmSeries != null)
            {
                confirmSeries.Dispose();
            }
            if (confirmtTitle != null)
            {
                confirmtTitle.Dispose();
            }
            if (confirmForm != null)
            {
                confirmForm.Dispose();
            }

            //結果表示用
            if (gofdisplayForm != null)
            {
                gofdisplayForm.Close();
            }
            if (gofChart != null)
            {
                gofChart.Dispose();
            }
            if (gofChartArea != null)
            {
                gofChartArea.Dispose();
            }
            if (gofLegend != null)
            {
                gofLegend.Dispose();
            }
            if (gofSeries != null)
            {
                gofSeries.Dispose();
            }
            if (gofTitle != null)
            {
                gofTitle.Dispose();
            }
            if (gofdisplayForm != null)
            {
                gofdisplayForm.Dispose();
            }

            //画像コンポーネントの開放
            if (resultimage != null)
            {
                resultimage.Image.Dispose();
                resultimage.Dispose();
            }
        }
예제 #2
0
 protected override void OnFormClosed(FormClosedEventArgs e)
 {
     base.OnFormClosed(e);
     _pictureBox.Dispose();
 }
예제 #3
0
        public void Recarga()
        {
            tiempo.Stop();
            contadorGif        = 0;
            pictureGif.Visible = false;
            pictureGif.Enabled = false;
            intento            = 1;
            lblPuntaje.Text    = puntuacion.ToString();

            for (int i = this.Controls.Count - 1; i >= 0; i--)
            {
                PictureBox control = this.Controls[i] as PictureBox;
                if (control == null)
                {
                    continue;
                }

                control.Dispose();
            }

            string startupPathNumeros = rutaImagenes + "//Numeros";

            posicionInicialArriba  = 130;
            posicionInicialCostado = 165;
            if (this.Tag.ToString() == "Facil")
            {
                Juego(1, 5);
                idDificultad = 1;
            }
            else if (this.Tag.ToString() == "Intermedia")
            {
                Juego(5, 10);
                idDificultad = 2;
            }
            else if (this.Tag.ToString() == "Dificil")
            {
                Juego(10, 20);
                idDificultad = 3;
            }
            if (respuestaCorrecta == 0)
            {
                opcionUno.BackgroundImage        = Image.FromFile(startupPathNumeros + @"\" + contador.ToString() + ".png");
                opcionUno.BackgroundImageLayout  = ImageLayout.Stretch;
                opcionDos.BackgroundImage        = Image.FromFile(startupPathNumeros + @"\" + respuestaIncorrecta1.ToString() + ".png");
                opcionDos.BackgroundImageLayout  = ImageLayout.Stretch;
                opcionTres.BackgroundImage       = Image.FromFile(startupPathNumeros + @"\" + respuestaIncorrecta2.ToString() + ".png");
                opcionTres.BackgroundImageLayout = ImageLayout.Stretch;
            }
            if (respuestaCorrecta == 1)
            {
                opcionUno.BackgroundImage        = Image.FromFile(startupPathNumeros + @"\" + respuestaIncorrecta1.ToString() + ".png");
                opcionUno.BackgroundImageLayout  = ImageLayout.Stretch;
                opcionDos.BackgroundImage        = Image.FromFile(startupPathNumeros + @"\" + contador.ToString() + ".png");
                opcionDos.BackgroundImageLayout  = ImageLayout.Stretch;
                opcionTres.BackgroundImage       = Image.FromFile(startupPathNumeros + @"\" + respuestaIncorrecta2.ToString() + ".png");
                opcionTres.BackgroundImageLayout = ImageLayout.Stretch;
            }
            if (respuestaCorrecta == 2)
            {
                opcionUno.BackgroundImage        = Image.FromFile(startupPathNumeros + @"\" + respuestaIncorrecta2.ToString() + ".png");
                opcionUno.BackgroundImageLayout  = ImageLayout.Stretch;
                opcionDos.BackgroundImage        = Image.FromFile(startupPathNumeros + @"\" + respuestaIncorrecta1.ToString() + ".png");
                opcionDos.BackgroundImageLayout  = ImageLayout.Stretch;
                opcionTres.BackgroundImage       = Image.FromFile(startupPathNumeros + @"\" + contador.ToString() + ".png");
                opcionTres.BackgroundImageLayout = ImageLayout.Stretch;
            }
        }
예제 #4
0
 public void Dispose()
 {
     Menu_Principal.Mesas.Remove(this);
     _mesa_PictureBox.Dispose();
     GC.SuppressFinalize(this);
 }