Example #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;
            }
        }
Example #2
0
 private static void atTheParty(IEmotionable e, ISocializable s)
 {
     Console.WriteLine("\nAt The Party : ");
     e.cry();
     e.laugh();
     s.wish();
     s.depart();
 }
Example #3
0
 private static void atTheMovie(IEmotionable e)
 {
     Console.WriteLine("\nAt The Movie : ");
     e.cry();
     e.laugh();
 }
Example #4
0
 public static void atTheMovie(IEmotionable obj)
 {
     Console.WriteLine("\nAt the Movie");
     obj.cry();
     obj.laugh();
 }