Esempio 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);
                }
            }
        }
Esempio n. 2
0
 public void Execute()
 {
     sound      = new OnetimeSound();
     sound.Name = GetFinalNewSoundName();
     sounds.Add(sound);
 }
Esempio n. 3
0
 public AddNewOnetimeSoundCommand(OnetimeSound sound, List <OnetimeSound> sounds)
 {
     this.sound  = sound;
     this.sounds = sounds;
 }