Ejemplo n.º 1
0
 public OutlinerNote(OutlinerDocument document, OutlinerNoteCollection Subnotes)
 {
     this.__Document  = document;
     this.__Parent    = null;
     __IsDocumentRoot = true;
     this.__Subnotes  = Subnotes;
     this.__Subnotes.Collection.CollectionChanged += new NotifyCollectionChangedEventHandler(Collection_CollectionChanged);
     Id    = s_id;
     s_id += 1;
     CreateColumnData();
 }
Ejemplo n.º 2
0
        public OutlinerNote(OutlinerNote parent)
        {
            this.__Document = parent.Document;
            this.__Parent   = parent;

            this.__Subnotes = new OutlinerNoteCollection();
            this.__Subnotes.Collection.CollectionChanged += new NotifyCollectionChangedEventHandler(Collection_CollectionChanged);
            CreateColumnData();

            Id    = s_id;
            s_id += 1;
        }
Ejemplo n.º 3
0
        public void Undo(OutlinerDocument document, TreeListView treeListView)
        {
            while (__UndoActions.Count > 0)
            {
                DocumentUndoAction action = __UndoActions.Pop();
                action.Undo(document, treeListView);

                __RedoActions.Push(action);
                DoUndoCountChanged();

                if (!action.UndoNext)
                {
                    break;
                }
            }

            GC.Collect();
        }
Ejemplo n.º 4
0
        public OutlinerNote FindOutlinerNoteByDocument(Guid documentGuid)
        {
            OutlinerNote foundNote = null;

            OutlinerDocument.WalkRecursively(RootNode,
                                             delegate(OutlinerNote note, out bool shouldWalkSubItems, out bool shouldContinue)
            {
                shouldContinue     = true;
                shouldWalkSubItems = true;
                if (note.OwnsDocument(documentGuid))
                {
                    foundNote      = note;
                    shouldContinue = false;
                }
            });

            return(foundNote);
        }
Ejemplo n.º 5
0
        internal OutlinerNote FindOutlinerNoteById(int noteId)
        {
            OutlinerNote foundNote = null;

            if (RootNode.Id == noteId)
            {
                return(RootNode);
            }

            OutlinerDocument.WalkRecursively(RootNode,
                                             delegate(OutlinerNote note, out bool shouldWalkSubItems, out bool shouldContinue)
            {
                shouldContinue     = true;
                shouldWalkSubItems = true;
                if (note.Id == noteId)
                {
                    foundNote      = note;
                    shouldContinue = false;
                }
            });

            return(foundNote);
        }