Example #1
0
        /// <summary>
        /// Delete an page using pageID - transform them in Empty Page and add to EmptyPageList
        /// If you delete a page, you can using same old instance of page - page will be converter to EmptyPage
        /// If need deleted page, use GetPage again
        /// [Set as Dirty]
        /// </summary>
        public void DeletePage(uint pageID, bool addSequence = false)
        {
            // get all pages in sequence or a single one
            var pages = addSequence ? this.GetSeqPages <BasePage>(pageID).ToArray() : new BasePage[] { this.GetPage <BasePage>(pageID) };

            // get my header page
            var header = this.GetPage <HeaderPage>(0);

            // adding all pages to FreeList
            foreach (var page in pages)
            {
                // create a new empty page based on a normal page
                var empty = new EmptyPage(page);

                // mark page as dirty
                this.SetDirty(empty);

                // add to empty free list
                this.AddOrRemoveToFreeList(true, empty, header, ref header.FreeEmptyPageID);
            }
        }
Example #2
0
 public static void Dump(this EmptyPage page, StringBuilder sb)
 {
     sb.AppendFormat("(empty)");
 }