Ejemplo n.º 1
0
 public void Init(DocumentView view, OpenDocumentData origin, OpenDocumentData append)
 {
     this.scroll      = view.Scroll;
     this.origin      = origin;
     this.append      = append;
     this.tmpFileName = null;
 }
Ejemplo n.º 2
0
        public override void Undo()
        {
            view.Scroll   = new System.Drawing.Point(0, 0);
            view.Document = null;
            OpenDocumentData open = view.OpenDocument(state.origin);

            view.Document = open.document;
        }
Ejemplo n.º 3
0
        public override void Do()
        {
            view.Scroll = new System.Drawing.Point(0, 0);
            if (state.tmpFileName == null)
            {
                state.tmpFileName = System.IO.Path.GetTempFileName();
                view.Document.Save(SaveFlags.Full, state.tmpFileName);
                state.origin.fileName = state.tmpFileName;
            }

            view.Document = null;
            OpenDocumentData first  = view.OpenDocument(state.origin); // first doc - original doc saved in tmp file
            OpenDocumentData second = view.OpenDocument(state.append); // second doc - it will be appended to first

            first.document.InsertPages(Document.LastPage, second.document, 0, Document.AllPages, PageInsertFlags.All);
            second.document.Dispose();

            view.Document = null;
            view.Document = first.document;
        }
Ejemplo n.º 4
0
 public State(DocumentView view, OpenDocumentData origin, OpenDocumentData append)
 {
     Init(view, origin, append);
 }