Exemplo n.º 1
0
        public static string Mostrar(Tempera cosa)
        {
            string retorno = "";

            if (cosa != null)             //Si la tempera pasada es null (no tiene nada)
            {
                retorno = cosa.Mostrar(); //Nos retornara la string cargada de mostrar
            }
            return(retorno);
        }
Exemplo n.º 2
0
        //Mostrar paleta con todas las temperas.
        private string Mostrar()
        {
            string aux = "";

            foreach (Tempera tempera in this._temperas)                          //Con el foreach, en el auxilar se le almacena las this.temperas
            {
                aux = aux + "" + Tempera.Mostrar(tempera);                       //Se van cargando todas y se van mostrando
            }
            return("Cantidad " + this._cantidadTemperas.ToString() + "-" + aux); //Retornamos la cantidad maxima y las temperas cargadas
        }
Exemplo n.º 3
0
        private void btnMod_Click(object sender, EventArgs e)
        {
            Tempera AuxTempera = null;
            string  s;

            if (this.lboxTempera.SelectedIndex >= 0)
            {
                AuxTempera = this.miPaleta[this.lboxTempera.SelectedIndex];
            }

            if (AuxTempera != null)
            {
                frmTempera NewForm = new frmTempera();
                NewForm.ShowDialog();

                if (NewForm.DialogResult == DialogResult.OK)
                {
                    if (NewForm.mitemperita.GetCantidad > 0)
                    {
                        this.lboxTempera.Items.Clear();
                        this.miPaleta -= AuxTempera;

                        //if (this.MiPaleta == NewForm.MiTemperita)
                        // {

                        this.miPaleta += NewForm.mitemperita;
                        //  }
                        // else
                        //  {
                        //  this.MiPaleta += NewForm.MiTemperita;
                        // }

                        for (int i = 0; i < 5; i++)
                        {
                            if (this.miPaleta[i] != null)
                            {
                                this.lboxTempera.Items.Add((string)this.miPaleta[i]);
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Error. Cantidad menor a 0");
                    }
                }
            }
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            //Tempera t = new Tempera(ConsoleColor.Black, "aaaa", 11);
            //Tempera t2 = new Tempera(ConsoleColor.Red, "ssss", int.MaxValue);
            //Console.WriteLine(t == t2);
            //Console.WriteLine((string)t);


            //Paleta a = new Paleta(11);
            Paleta  a = 3;
            Tempera c = new Tempera(ConsoleColor.Red, "aaaa", 4);
            Tempera d = new Tempera(ConsoleColor.Green, "bbbb", 3);

            //a = 3;
            a  = a + c;
            a += d;
            Console.WriteLine((string)a);
            Console.ReadKey();
        }