コード例 #1
0
        public static void IncreaseIndent(OutlinerNote row, TreeListView outlinerTree, bool applyStyle)
        {
            if (!CanIncreaseIndent(row))
            {
                return;
            }

            int  activeColumn        = DocumentHelpers.GetFocusedColumnIdx(outlinerTree, row);
            bool isInlineNoteFocused = DocumentHelpers.IsInlineNoteFocused(outlinerTree);

            ObservableCollection <OutlinerNote> parentCollection = row.Document.GetParentCollection(row);
            int idx = GetNoteIndexAtParent(row);

            parentCollection.Remove(row);

            OutlinerNote newNote = new OutlinerNote(parentCollection[idx - 1]);

            newNote.Clone(row);

            DocumentHelpers.CopyNodesRecursively(newNote, row);

            parentCollection[idx - 1].SubNotes.Add(newNote);
            parentCollection[idx - 1].IsExpanded = true;

            row.Parent.UpdateParentCheckboxes();
            newNote.UpdateParentCheckboxes();
            if (applyStyle)
            {
                outlinerTree.MakeActive(newNote, activeColumn, isInlineNoteFocused, new EventHandler(ApplyStyleAfterMakeActive));
            }
            else
            {
                outlinerTree.MakeActive(newNote, activeColumn, isInlineNoteFocused);
            }
        }