Ejemplo n.º 1
0
        private void createAlgorithmList()
        {
            var lyrics = BindableLyrics.ToArray();

            caretMovingAlgorithmSet = new Dictionary <Mode, ICaretPositionAlgorithm>
            {
                { Mode.EditMode, new CuttingCaretPositionAlgorithm(lyrics) },
                { Mode.TypingMode, new TypingCaretPositionAlgorithm(lyrics) },
                { Mode.RecordMode, new TimeTagCaretPositionAlgorithm(lyrics)
                  {
                      Mode = RecordingMovingCaretMode
                  } },
                { Mode.TimeTagEditMode, new TimeTagIndexCaretPositionAlgorithm(lyrics) }
            };
        }
Ejemplo n.º 2
0
        private void initialCaretPositionAlgorithm()
        {
            var lyrics = BindableLyrics.ToArray();

            algorithm = getAlgorithmByMode(Mode);

            ICaretPositionAlgorithm getAlgorithmByMode(LyricEditorMode mode)
            {
                switch (mode)
                {
                case LyricEditorMode.Manage:
                    return(new CuttingCaretPositionAlgorithm(lyrics));

                case LyricEditorMode.Typing:
                    return(new TypingCaretPositionAlgorithm(lyrics));

                case LyricEditorMode.EditRubyRomaji:
                    return(new NavigateCaretPositionAlgorithm(lyrics));

                case LyricEditorMode.CreateTimeTag:
                    return(new TimeTagIndexCaretPositionAlgorithm(lyrics));

                case LyricEditorMode.RecordTimeTag:
                    return(new TimeTagCaretPositionAlgorithm(lyrics)
                    {
                        Mode = RecordingMovingCaretMode
                    });

                case LyricEditorMode.AdjustTimeTag:
                case LyricEditorMode.CreateNote:
                case LyricEditorMode.CreateNotePosition:
                case LyricEditorMode.AdjustNote:
                case LyricEditorMode.Layout:
                case LyricEditorMode.Singer:
                    return(new NavigateCaretPositionAlgorithm(lyrics));

                default:
                    return(null);
                }
            }
        }