Beispiel #1
0
 protected override ITelephoneCommunication ChooseMedium(int chosenOption)
 {
     ITelephoneCommunication communication;
     switch (chosenOption)
     {
         case 1:
             communication = new PhotoCommunication();
             break;
         case 2:
             communication = new SmsCommunication();
             break;
         case 3:
             communication = new VoiceCommunication();
             break;
         default:
             communication = null;
             break;
     }
     return communication;
 }
Beispiel #2
0
        protected override ITelephoneCommunication ChooseMedium(int chosenOption)
        {
            ITelephoneCommunication communication;

            switch (chosenOption)
            {
            case 1:
                communication = new PhotoCommunication();
                break;

            case 2:
                communication = new SmsCommunication();
                break;

            case 3:
                communication = new VoiceCommunication();
                break;

            default:
                communication = null;
                break;
            }
            return(communication);
        }