Exemplo n.º 1
0
        public override void Undo()
        {
            view.Scroll = state.scroll;
            Document doc  = view.Document;
            FitModes fit  = view.CurrentFit;
            double   zoom = view.Zoom;
            Bookmark root = doc.BookmarkRoot;

            if (root != null)
            {
                Bookmark child = GetRootBookmark(root, state.bookmarks);
                if (child != null)
                {
                    child.Destroy();
                }
            }
            if (doc.OptionalContentGroups.Count > state.layers)
            {
                IList <OptionalContentGroup> groups = doc.OptionalContentGroups;
                for (int i = state.layers; i < groups.Count; ++i)
                {
                    doc.RemoveOCG(groups[i]);
                }
            }
            view.ClearPageCache();
            doc.DeletePages(state.pages, doc.NumPages - 1);
            view.Document = doc;
            view.setZoom(fit, zoom);
        }