internal void UpdateBottomlessPage()
        {
            if (this.IsEmpty)
            {
                return;
            }
            this.OnBeforeFormatPage(false, true);
            if (TracePageFormatting.IsEnabled)
            {
                TracePageFormatting.Trace(TraceEventType.Start, TracePageFormatting.FormatPage, this.PageContext, this.PtsContext);
            }
            PTS.FSFMTRBL fsfmtrbl;
            int          num = PTS.FsUpdateBottomlessPage(this.PtsContext.Context, this._ptsPage.Value, this._section.Handle, out fsfmtrbl);

            if (num != 0)
            {
                this.DestroyPage();
                PTS.ValidateAndTrace(num, this.PtsContext);
            }
            if (TracePageFormatting.IsEnabled)
            {
                TracePageFormatting.Trace(TraceEventType.Stop, TracePageFormatting.FormatPage, this.PageContext, this.PtsContext);
            }
            this.OnAfterFormatPage(true, true);
            if (fsfmtrbl == PTS.FSFMTRBL.fmtrblInterrupted)
            {
                this.DeferFormattingToBackground();
            }
        }
        internal void CreateBottomlessPage()
        {
            this.OnBeforeFormatPage(false, false);
            if (TracePageFormatting.IsEnabled)
            {
                TracePageFormatting.Trace(TraceEventType.Start, TracePageFormatting.FormatPage, this.PageContext, this.PtsContext);
            }
            PTS.FSFMTRBL fsfmtrbl;
            IntPtr       value;
            int          num = PTS.FsCreatePageBottomless(this.PtsContext.Context, this._section.Handle, out fsfmtrbl, out value);

            if (num != 0)
            {
                this._ptsPage.Value = IntPtr.Zero;
                PTS.ValidateAndTrace(num, this.PtsContext);
            }
            else
            {
                this._ptsPage.Value = value;
            }
            if (TracePageFormatting.IsEnabled)
            {
                TracePageFormatting.Trace(TraceEventType.Stop, TracePageFormatting.FormatPage, this.PageContext, this.PtsContext);
            }
            this.OnAfterFormatPage(true, false);
            if (fsfmtrbl == PTS.FSFMTRBL.fmtrblInterrupted)
            {
                this.DeferFormattingToBackground();
            }
        }
        internal void CreateFinitePage(PageBreakRecord breakRecord)
        {
            this.OnBeforeFormatPage(true, false);
            if (TracePageFormatting.IsEnabled)
            {
                TracePageFormatting.Trace(TraceEventType.Start, TracePageFormatting.FormatPage, this.PageContext, this.PtsContext);
            }
            IntPtr pfsBRPageStart = (breakRecord != null) ? breakRecord.BreakRecord : IntPtr.Zero;

            PTS.FSFMTR fsfmtr;
            IntPtr     value;
            IntPtr     zero;
            int        num = PTS.FsCreatePageFinite(this.PtsContext.Context, pfsBRPageStart, this._section.Handle, out fsfmtr, out value, out zero);

            if (num != 0)
            {
                this._ptsPage.Value = IntPtr.Zero;
                zero = IntPtr.Zero;
                PTS.ValidateAndTrace(num, this.PtsContext);
            }
            else
            {
                this._ptsPage.Value = value;
            }
            if (zero != IntPtr.Zero)
            {
                StructuralCache structuralCache = this._section.StructuralCache;
                if (structuralCache != null)
                {
                    this._breakRecord = new PageBreakRecord(this.PtsContext, new SecurityCriticalDataForSet <IntPtr>(zero), (breakRecord != null) ? (breakRecord.PageNumber + 1) : 1);
                }
            }
            if (TracePageFormatting.IsEnabled)
            {
                TracePageFormatting.Trace(TraceEventType.Stop, TracePageFormatting.FormatPage, this.PageContext, this.PtsContext);
            }
            this.OnAfterFormatPage(true, false);
        }
        internal void UpdateFinitePage(PageBreakRecord breakRecord)
        {
            if (this.IsEmpty)
            {
                return;
            }
            this.OnBeforeFormatPage(true, true);
            if (TracePageFormatting.IsEnabled)
            {
                TracePageFormatting.Trace(TraceEventType.Start, TracePageFormatting.FormatPage, this.PageContext, this.PtsContext);
            }
            IntPtr pfsBRPageStart = (breakRecord != null) ? breakRecord.BreakRecord : IntPtr.Zero;

            PTS.FSFMTR fsfmtr;
            IntPtr     intPtr;
            int        num = PTS.FsUpdateFinitePage(this.PtsContext.Context, this._ptsPage.Value, pfsBRPageStart, this._section.Handle, out fsfmtr, out intPtr);

            if (num != 0)
            {
                this.DestroyPage();
                PTS.ValidateAndTrace(num, this.PtsContext);
            }
            if (intPtr != IntPtr.Zero)
            {
                StructuralCache structuralCache = this._section.StructuralCache;
                if (structuralCache != null)
                {
                    this._breakRecord = new PageBreakRecord(this.PtsContext, new SecurityCriticalDataForSet <IntPtr>(intPtr), (breakRecord != null) ? (breakRecord.PageNumber + 1) : 1);
                }
            }
            if (TracePageFormatting.IsEnabled)
            {
                TracePageFormatting.Trace(TraceEventType.Stop, TracePageFormatting.FormatPage, this.PageContext, this.PtsContext);
            }
            this.OnAfterFormatPage(true, true);
        }