Catrobat.IDE.Core.ViewModels.Editor.Sounds.ChangeSoundViewModel.SaveAction C# (CSharp) Method

SaveAction() private method

private SaveAction ( ) : void
return void
        private async void SaveAction()
        {
            string validName = await ServiceLocator.ContextService.ConvertToValidFileName(SoundName);
            if (validName != ReceivedSound.Name)
            {
                List<string> nameList = new List<string>();
                foreach (var soundItem in _receivedSelectedSprite.Sounds)
                {
                    nameList.Add(soundItem.Name);
                }
                SoundName = await ServiceLocator.ContextService.FindUniqueName(validName, nameList);
                ReceivedSound.Name = SoundName;
                CurrentProgram.Save();
            }
            base.GoBackAction();
        }