Esempio n. 1
0
        public DPage InsertPageAfter(DPage prePage)
        {
            var index = Pages.IndexOf(prePage);
            if (index < 0) return null;

            var page = new DPage();
            if (prePage.NextPage == null)
            {
                prePage.NextPage = page;
                page.PrePage = prePage;
            }
            else
            {
                page.PrePage = prePage;
                page.NextPage = prePage.NextPage;
                prePage.NextPage.PrePage = page;
                prePage.NextPage = page;
            }

            page.SetDocument(page.PrePage.GetDocument());
            page.X = prePage.X;
            page.Initialize();

            Pages.Add(page);
            CurrentPage = page;

            Context.AutoScrollMinSize = new Size(page.MarginLeft + page.Width + page.MarginRight,
                page.MarginTop + (page.Height + page.Spacing) * Pages.Count + page.OffsetY);

            return page;
        }
Esempio n. 2
0
        public DPage InsertPage()
        {
            var page = new DPage();
            page.SetDocument(this);

            if (Pages.Count == 0)
            {
                page.Index = 1;
            }
            else
            {
                var lpage = Pages[Pages.Count - 1];
                lpage.NextPage = page;
                page.PrePage = lpage;
                page.X = lpage.X;
                page.SetDocument(lpage.GetDocument());
            }

            page.Initialize();

            Pages.Add(page);
            CurrentPage = page;

            Context.AutoScrollMinSize = new Size(page.MarginLeft + page.Width + page.MarginRight,
                page.MarginTop + (page.Height + page.Spacing) * Pages.Count + page.OffsetY);

            return page;
        }