コード例 #1
0
 protected virtual void ExecuteInsertPerformerCommand(string[] commandWords)
 {
     switch (commandWords[2])
     {
         case "singer":
             var singer = new Singer(commandWords[3]);
             this.InsertPerformer(singer);
             break;
         default:
             break;
     }
 }
コード例 #2
0
        protected virtual void ExecuteInsertPerformerCommand(string[] commandWords)
        {
            switch (commandWords[2])
            {
            case "singer":
                var singer = new Singer(commandWords[3]);
                this.InsertPerformer(singer);
                break;

            default:
                break;
            }
        }
コード例 #3
0
 protected override void ExecuteInsertPerformerCommand(string[] commandWords)
 {
     switch (commandWords[2])
     {
         case "singer":
             var singer = new Singer(commandWords[3]);
             this.InsertPerformer(singer);
             break;
         case "band":
             var band = new Band(commandWords[3]);
             this.InsertPerformer(band);
             break;
         default:
             base.ExecuteInsertPerformerCommand(commandWords);
             break;
     }
 }
コード例 #4
0
        protected virtual string GetSingerReport(Singer singer)
        {
            StringBuilder singerInfo = new StringBuilder();

            singerInfo.Append(singer.Name + ": ");
            if (singer.Songs.Any())
            {
                var songs = singer.Songs
                            .Select(s => s.Title)
                            .OrderBy(s => s);
                singerInfo.Append(string.Join("; ", songs));
            }
            else
            {
                singerInfo.Append("no songs");
            }

            return(singerInfo.ToString());
        }
コード例 #5
0
        protected virtual string GetSingerReport(Singer singer)
        {
            StringBuilder singerInfo = new StringBuilder();
            singerInfo.Append(singer.Name + ": ");
            if (singer.Songs.Any())
            {
                var songs = singer.Songs
                  .Select(s => s.Title)
                  .OrderBy(s => s);
                singerInfo.Append(string.Join("; ", songs));
            }
            else
            {
                singerInfo.Append("no songs");
            }

            return singerInfo.ToString();
        }