Ejemplo n.º 1
0
        static void PrintInfo(object obj)
        {   /*  if (obj is ISocializable )
             * {
             *  ISocializable iso = (ISocializable)obj;
             *  iso.depart();
             *  iso.wish();
             *  return;
             * }
             */
            if (obj is ISocializable && obj is IEmotionable)
            {
                ISocializable iso = (ISocializable)obj;
                IEmotionable  imo = (IEmotionable)obj;
                iso.depart();
                iso.wish();
                imo.cry();
                imo.laugh();
                return;
            }

            if (obj is IEmotionable && !(obj is ISocializable))
            {
                IEmotionable imo = (IEmotionable)obj;
                imo.cry();
                imo.laugh();
                return;
            }
        }
Ejemplo n.º 2
0
 private static void atTheParty(IEmotionable e, ISocializable s)
 {
     Console.WriteLine("\nAt The Party : ");
     e.cry();
     e.laugh();
     s.wish();
     s.depart();
 }