Пример #1
0
        /// <summary>
        /// Initializes a new instance of page.
        /// </summary>
        /// <param name="manager"></param>
        /// <param name="index"></param>
        /// <param name="content"></param>
        internal Page(IPageManager manager, long index, byte[] content)
        {
            if (content == null)
            {
                throw new ArgumentNullException(nameof(content));
            }

            if (manager == null)
            {
                throw new ArgumentNullException(nameof(manager));
            }

            if (index < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(index), "Page index should not be negative");
            }

            _index   = index;
            _content = content;
            _manager = manager;

            if (!manager.CheckPage(this))
            {
                throw new InvalidOperationException("Page manager does not accept page");
            }
        }
Пример #2
0
 /// <summary>
 /// Checks if this page manager instance can
 /// operate with specified page.
 /// This is needed to properly creation of pages.
 /// </summary>
 /// <param name="page"></param>
 /// <returns></returns>
 public bool CheckPage(IPage page)
 {
     CheckDisposed();
     return(_underlyingPageManager.CheckPage(page));
 }