Example #1
0
 public void OnNewButtonClicked(object obj)
 {
     _editorState = LyricsEditorState.Adding;
     CanExecuteApply = false;
     ClearVerse();
     New();
 }
Example #2
0
 private void ResetEditor()
 {
     EditorText = "";
     EditorIndex = Constants.INVALID_VERSE_INDEX;
     _editorState = LyricsEditorState.None;
 }
Example #3
0
 public void OnApplyButtonClicked(object obj)
 {
     if (Validate())
     {
         if (_editorState != LyricsEditorState.Applying)
         {
             _editorState = LyricsEditorState.Applying;
             if (_selectedVerse != null)
             {
                 SelectedVerse.Text = EditorText;
             }
             else
             {
                 _verseSequence = Verses.Count * Defaults.SequenceIncrement;
                 _verseIndex = Verses.Count + 1;
                 Repository.DataService.Verse verse = VerseManager.Create(CompositionManager.Composition.Id, _verseSequence);
                 verse.Text = EditorText;
                 verse.Index = (short)_verseIndex;
                 verse.Sequence = _verseSequence;
                 Verses.Add(verse);
                 CompositionManager.Composition.Verses.Add(verse);
             }
             UpdateSubverses();
             ClearVerse();
         }
         Infrastructure.EditorState.VerseCount = Verses.Count;
         EA.GetEvent<AdjustBracketHeight>().Publish(string.Empty);
     }
 }