public FormTempera(Tempera miTempera) : this()
        {
            MiTempera = miTempera;
            sbyte cantidad = MiTempera;

            this.textBox2.Text          = cantidad.ToString();
            this.textBox1.Text          = MiTempera.Marca;
            this.comboBox1.SelectedItem = MiTempera.Color;
        }
Пример #2
0
        public static Tempera operator +(Tempera p, Tempera t)
        {
            Tempera retorno = new Tempera(p._marca, p._color, p._cantidad);

            if (p == t)
            {
                retorno._cantidad += t._cantidad;
            }
            return(retorno);
        }
Пример #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            //FormTempera frm = new FormTempera();

            /*string a;
             * int i = 0;
             *
             * a = this.listBox1.SelectedItem.ToString();
             *
             * foreach (Tempera item in this.MiPaleta.MisTemperas)
             * {
             *  if (item.Mostrar(item) == a)
             *  {
             *      this.MiPaleta.MisTemperas.RemoveAt(i);
             *      this.MiPaleta.MisTemperas.Insert(i,null);
             *      break;
             *  }
             *  i++;
             * }
             * this.listBox1.Items.Clear();
             * foreach (Tempera item in this.MiPaleta.MisTemperas)
             * {
             *  if (!Equals(item, null))
             *  {
             *      listBox1.Items.Add(item.Mostrar(item));
             *  }
             * }*/

            FormTempera frmTempera;
            int         lugar = listBox1.SelectedIndex;

            MessageBox.Show(Tempera.Mostrar(MiPaleta.MisTemperas[lugar]));
            frmTempera = new FormTempera(MiPaleta.MisTemperas[lugar]);
            frmTempera.ShowDialog();
            if (frmTempera.DialogResult == DialogResult.OK)
            {
                MiPaleta.MisTemperas.Remove(MiPaleta.MisTemperas[lugar]);
                this.listBox1.Items.Clear();
                foreach (Tempera item in this.MiPaleta.MisTemperas)
                {
                    if (!Equals(item, null))
                    {
                        listBox1.Items.Add(Tempera.Mostrar(item));
                    }
                }
            }
        }
Пример #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            FormTempera frm = new FormTempera();

            frm.ShowDialog();

            if (frm.DialogResult == DialogResult.OK)
            {
                this.MiPaleta += frm.MiTempera;
                this.listBox1.Items.Clear();

                foreach (Tempera item in this.MiPaleta.MisTemperas)
                {
                    if (!Equals(item, null))
                    {
                        listBox1.Items.Add(Tempera.Mostrar(item));
                    }
                }
            }
        }
Пример #5
0
 public static String Mostrar(Tempera t)
 {
     return(t.Mostrar());
 }
 private void button1_Click(object sender, EventArgs e)
 {
     this._miTempera   = new Tempera((ConsoleColor)this.comboBox1.SelectedItem, this.textBox1.Text, sbyte.Parse(this.textBox2.Text));
     this.DialogResult = DialogResult.OK;
 }
Пример #7
0
 static void Main(string[] args)
 {
     Tempera miT = new Tempera();
 }