コード例 #1
0
        /**
         * Deletes the chapter data control in the given position. It also updates
         * automatically the selectedChapter if necessary
         *
         * @param chapter
         */
        public ChapterDataControl removeChapterDataControl(int index)
        {
            chapters.RemoveAt(index);
            ChapterDataControl removed = chapterDataControlList[index];

            chapterDataControlList.RemoveAt(index);
            chapterToolManagers.RemoveAt(index);
            setSelectedChapterInternal(selectedChapter - 1);
            return(removed);
        }
コード例 #2
0
        public bool replaceSelectedChapter(Chapter newChapter)
        {
            int chapter = this.getSelectedChapter();

            chapters[getSelectedChapter()]  = newChapter;
            chapterDataControlList[chapter] = new ChapterDataControl(newChapter);
            identifierSummary = new IdentifierSummary(newChapter);
            identifierSummary.loadIdentifiers(getSelectedChapterData());

            return(true);
        }
コード例 #3
0
        /**
         * Moves the selected chapter to the next position of the chapter's list.
         *
         */
        public bool moveChapterDown(int index)
        {
            // If the chapter can be moved
            if (index < chapterDataControlList.Count - 1)
            {
                // Move the chapter and update the selected chapter
                Chapter c = chapters[index];
                chapters.RemoveAt(index);
                chapters.Insert(index + 1, c);
                // Move the chapter and update the selected chapter
                ChapterDataControl con = chapterDataControlList[index];
                chapterDataControlList.RemoveAt(index);
                chapterDataControlList.Insert(index + 1, con);

                setSelectedChapterInternal(index + 1);
                return(true);
            }
            return(false);
        }
コード例 #4
0
        /**
         * Moves the selected chapter to the previous position of the chapter's
         * list.
         */
        public bool moveChapterUp(int index)
        {
            // If the chapter can be moved
            if (index > 0)
            {
                // Move the chapter and update the selected chapter
                Chapter c = chapters[index];
                chapters.RemoveAt(index);
                chapters.Insert(index - 1, c);
                // Move the chapter and update the selected chapter
                ChapterDataControl con = chapterDataControlList[index];
                chapterDataControlList.RemoveAt(index);
                chapterDataControlList.Insert(index - 1, con);

                ChapterToolManager man = chapterToolManagers[index];
                chapterToolManagers.RemoveAt(index);
                chapterToolManagers.Insert(index - 1, man);

                setSelectedChapterInternal(index - 1);
                return(true);
            }
            return(false);
        }
コード例 #5
0
            private string GetScenePropertyId(ChapterDataControl chapter, SceneDataControl scene)
            {
                var index = Controller.Instance.ChapterList.getChapters().IndexOf(chapter);

                return("Chapter" + index + "." + scene.getId());
            }