Exemple #1
0
        public void Redo(OutlinerDocument document, TreeListView treeListView)
        {
            while (__RedoActions.Count > 0)
            {
                DocumentUndoAction action = __RedoActions.Pop();
                action.Redo(document, treeListView);

                __UndoActions.Push(action);
                DoUndoCountChanged();

                if (__RedoActions.Count > 0)
                {
                    var nextAction = __RedoActions.Peek();
                    if (!nextAction.UndoNext)
                    {
                        break;
                    }
                }
            }
            GC.Collect();
        }
Exemple #2
0
 public static void DeleteRow(OutlinerNote row, TreeListView outlinerTree)
 {
     DeleteRow(row, outlinerTree, -1);
 }
Exemple #3
0
        public static void IncreaseIndentWithLimit(OutlinerNote row, OutlinerNote limit, bool isInlineNoteFocused, TreeListView outlinerTree, bool applyStyle)
        {
            if (!CanIncreaseIndent(row))
            {
                return;
            }

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

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

            parentCollection.Remove(row);

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

            newNote.Clone(row);

            int insertIntoIdx = parentCollection[idx - 1].SubNotes.Count;

            if (limit == row)
            {
                DocumentHelpers.CopyNodesRecursively(parentCollection[idx - 1], row);
            }
            else
            {
                DocumentHelpers.CopyNodesRecursively(newNote, parentCollection[idx - 1], row, limit);
            }

            parentCollection[idx - 1].SubNotes.Insert(insertIntoIdx, 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);
            }
        }
Exemple #4
0
        public static bool IsInlineNoteFocused(TreeListView outlinerTree)
        {
            MainWindow mainWindow = DragDropHelper.GetMainWindow(outlinerTree);

            return(mainWindow.IsInlineNoteFocused);
        }