public static Tempera operator +(Tempera t, sbyte s)
        {
            Tempera t2 = new Tempera((sbyte)t._cantidad, t._color, t._marca);

            if ((object)t != null)
            {
                t2._cantidad = t._cantidad += s;
            }
            return(t2);
        }
        public static Tempera operator +(Tempera t1, Tempera t2)
        {
            Tempera t3 = new Tempera((sbyte)t1._cantidad, t1._color, t1._marca);

            if ((object)t1 != null && (object)t2 != null)
            {
                if (t1 == t2)
                {
                    t3._cantidad += t2._cantidad;
                }
            }
            return(t3);
        }
Example #3
0
        private int ObtenerIndice(Tempera t)
        {
            int indice = -1;
            int i      = 0;

            foreach (Tempera item in this._colores)
            {
                if (this._colores.GetValue(i) != null)
                {
                    if (t == item)
                    {
                        indice = i;
                        break;
                    }
                }
                i++;
            }

            return(indice);
        }