Beispiel #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);
 }
        static void Main(string[] args)
        {
            Console.Title = "Ejercicio Clase 07";
            Tempera tempera_1 = new Tempera(55, ConsoleColor.DarkBlue, "China");
            Tempera tempera_2 = new Tempera(78, ConsoleColor.DarkYellow, "Argentina");

            Console.Write(tempera_1);
            Console.Write(tempera_2);

            Console.ReadLine();
        }
Beispiel #3
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);
 }