Ejemplo n.º 1
0
        private string GetFinalNewSoundName()
        {
            string proposalFinalSoundName = newSoundName;
            int    index = 0;

            while (true)
            {
                OnetimeSound foundSound = sounds.Find(sound => sound.Name == proposalFinalSoundName);
                if (foundSound == null)
                {
                    return(proposalFinalSoundName);
                }
                else
                {
                    index++;
                    proposalFinalSoundName = String.Concat(newSoundName, index);
                }
            }
        }
Ejemplo n.º 2
0
 public void Execute()
 {
     sound      = new OnetimeSound();
     sound.Name = GetFinalNewSoundName();
     sounds.Add(sound);
 }
Ejemplo n.º 3
0
 public AddNewOnetimeSoundCommand(OnetimeSound sound, List <OnetimeSound> sounds)
 {
     this.sound  = sound;
     this.sounds = sounds;
 }