コード例 #1
0
        static void Main(string[] args)
        {
            Tempera temp  = new Tempera(ConsoleColor.Cyan, "Colorin", 20);
            Tempera temp1 = new Tempera(ConsoleColor.Cyan, "Colorin", 10);
            Tempera temp2 = new Tempera(ConsoleColor.Black, "ColorOtro", 10);

            Paleta p = 5;

            p += temp;
            p += temp1;
            p += temp2;

            Console.Write((string)p);

            for (int i = 0; i < p.cantidadMaxColores; i++)
            {
                if (!Object.Equals(p[i], null))
                {
                    p[i].marca = "";
                }



                p[i] = new Tempera(ConsoleColor.DarkMagenta, "ColorOtro", 10);
                Console.Write(p[i]);
            }

            Console.ReadKey();
        }
コード例 #2
0
 public Form1()
 {
     InitializeComponent();
     this._paleta            = 5;
     this.groupBox1.Text     = "Paleta de colores";
     this.textBox1.Multiline = true;
     this.groupBox1.Visible  = false;
     this.button1.Text       = "+";
     this.button2.Text       = "-";
 }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            FrmTempera   colores      = new FrmTempera();
            DialogResult dialogResult = ShowDialog();

            if (dialogResult == DialogResult.OK)
            {
                this._paleta  += colores.Tempera;
                textBox1.Text += (string)this._paleta;
            }
        }
コード例 #4
0
ファイル: Paleta.cs プロジェクト: CanteroAgustin/Lab_2_Ej
        private static string Mostrar(Paleta paleta)
        {
            string retorno = "Cantidad maxima de colores: " + paleta._cantidadMaxColores;

            for (int i = 0; i < paleta._cantidadMaxColores; i++)
            {
                if (paleta._temperas.GetValue(i) != null)
                {
                    retorno += "\n" + paleta._temperas[i];
                }
            }
            return(retorno);
        }