Exemplo n.º 1
0
 public static Tempera operator +(Tempera T, sbyte C)
 {
     if (!object.Equals(T, null))
     {
         Tempera T2 = new Tempera((sbyte)(T._cantidad + C), T._color, T._marca);
         return(T2);
     }
     return(null);
 }
        //METODO MOSTRAR
        private string Mostrar()
        {
            string retorno = "La paleta tiene " + this._cantidadMaxima + " pinturas.\n";

            foreach (Tempera temp in this._temperas)
            {
                retorno += Tempera.Mostrar(temp);
            }
            return(retorno);
        }
Exemplo n.º 3
0
 private Int32 ObtenerIndice(Tempera t)
 {
     for (int i = 0; i < this._colores.Count; i++)
     {
         if (this._colores[i] == t)
         {
             return(i);
         }
     }
     return(-1);
 }
 public static string Mostrar(Tempera temp)
 {
     if (!Object.Equals(temp, null))
     {
         return(temp.Mostrar());
     }
     else
     {
         return("");
     }
 }
Exemplo n.º 5
0
 public static Tempera operator +(Tempera T1, Tempera T2)
 {
     if (!object.Equals(T1, null) && !object.Equals(T2, null))
     {
         Tempera T3 = new Tempera(T1._cantidad, T1._color, T1._marca);
         if (T1 == T2)
         {
             T3 += T2._cantidad;
             return(T3);
         }
     }
     return(null);
 }
        private int ObtenerIndice(Tempera T)
        {
            int index    = -1;
            int contador = 0;

            foreach (Tempera item in this._colores)
            {
                if (this._colores.GetValue(contador) != null)
                {
                    if (T == item)
                    {
                        index = contador;
                        break;
                    }
                }
                contador++;
            }
            return(index);
        }
Exemplo n.º 7
0
 public static string Mostrar(Tempera t)
 {
     return(t.Mostrar());
 }