FixedDocumentPaginator.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / MS / Internal / documents / FixedDocumentPaginator.cs / 1 / FixedDocumentPaginator.cs

                            //---------------------------------------------------------------------------- 
//
// Copyright (C) Microsoft Corporation.  All rights reserved.
//
// File: FixedDocumentPaginator.cs 
//
// Description: This is the abstract base class for all paginating layouts. 
//              It provides default implementations for the asynchronous 
//              versions of GetPage and ComputePageCount.
// 
// History:
//  08/29/2005 : grzegorz - created.
//
//--------------------------------------------------------------------------- 

using System;                       // IServiceProvider 
using System.ComponentModel;        // AsyncCompletedEventArgs 
using System.Windows;               // Size
using System.Windows.Documents;     // DocumentPaginator 
using System.Windows.Media;         // Visual

namespace MS.Internal.Documents
{ 
    /// 
    /// This is the abstract base class for all paginating layouts. It 
    /// provides default implementations for the asynchronous versions of 
    /// GetPage and ComputePageCount.
    ///  
    internal class FixedDocumentPaginator : DynamicDocumentPaginator, IServiceProvider
    {
        //-------------------------------------------------------------------
        // 
        //  Constructors
        // 
        //------------------------------------------------------------------- 

        #region Constructors 

        /// 
        /// Constructor
        ///  
        internal FixedDocumentPaginator(FixedDocument document)
        { 
            _document = document; 
        }
 
        #endregion Constructors

        //--------------------------------------------------------------------
        // 
        //  Public Methods
        // 
        //------------------------------------------------------------------- 

        #region Public Methods 

        /// 
        /// 
        ///  
        public override DocumentPage GetPage(int pageNumber)
        { 
            return _document.GetPage(pageNumber); 
        }
 
        /// 
        /// 
        /// 
        public override void GetPageAsync(int pageNumber, object userState) 
        {
            _document.GetPageAsync(pageNumber, userState); 
        } 

        ///  
        /// 
        /// 
        public override void CancelAsync(object userState)
        { 
            _document.CancelAsync(userState);
        } 
 
        /// 
        ///  
        /// 
        public override int GetPageNumber(ContentPosition contentPosition)
        {
            return _document.GetPageNumber(contentPosition); 
        }
 
        ///  
        /// 
        ///  
        public override ContentPosition GetPagePosition(DocumentPage page)
        {
            return _document.GetPagePosition(page);
        } 

        ///  
        ///  
        /// 
        public override ContentPosition GetObjectPosition(Object o) 
        {
            return _document.GetObjectPosition(o);
        }
 
        #endregion Public Methods
 
        //-------------------------------------------------------------------- 
        //
        //  Public Properties 
        //
        //--------------------------------------------------------------------

        #region Public Properties 

        ///  
        ///  
        /// 
        public override bool IsPageCountValid 
        {
            get { return _document.IsPageCountValid; }
        }
 
        /// 
        ///  
        ///  
        public override int PageCount
        { 
            get { return _document.PageCount;  }
        }

        ///  
        /// 
        ///  
        public override Size PageSize 
        {
            get { return _document.PageSize; } 
            set { _document.PageSize = value; }
        }

        ///  
        /// 
        ///  
        public override IDocumentPaginatorSource Source 
        {
            get { return _document; } 
        }

        #endregion Public Properties
 
        //-------------------------------------------------------------------
        // 
        //  Internal Methods 
        //
        //-------------------------------------------------------------------- 

        #region Internal Methods

        internal void NotifyGetPageCompleted(GetPageCompletedEventArgs e) 
        {
            OnGetPageCompleted(e); 
        } 

        internal void NotifyPaginationCompleted(EventArgs e) 
        {
            OnPaginationCompleted(e);
        }
 
        internal void NotifyPaginationProgress(PaginationProgressEventArgs e)
        { 
            OnPaginationProgress(e); 
        }
 
        internal void NotifyPagesChanged(PagesChangedEventArgs e)
        {
            OnPagesChanged(e);
        } 

        #endregion Internal Methods 
 
        //-------------------------------------------------------------------
        // 
        //  Private Fields
        //
        //-------------------------------------------------------------------
 
        #region Private Fields
 
        private readonly FixedDocument _document; 

        #endregion Private Fields 

        //-------------------------------------------------------------------
        //
        //  IServiceProvider Members 
        //
        //-------------------------------------------------------------------- 
 
        #region IServiceProvider Members
 
        /// 
        /// Returns service objects associated with this control.
        /// 
        /// Specifies the type of service object to get. 
        object IServiceProvider.GetService(Type serviceType)
        { 
            return ((IServiceProvider)_document).GetService(serviceType); 
        }
 
        #endregion IServiceProvider Members
    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------------------- 
//
// Copyright (C) Microsoft Corporation.  All rights reserved.
//
// File: FixedDocumentPaginator.cs 
//
// Description: This is the abstract base class for all paginating layouts. 
//              It provides default implementations for the asynchronous 
//              versions of GetPage and ComputePageCount.
// 
// History:
//  08/29/2005 : grzegorz - created.
//
//--------------------------------------------------------------------------- 

using System;                       // IServiceProvider 
using System.ComponentModel;        // AsyncCompletedEventArgs 
using System.Windows;               // Size
using System.Windows.Documents;     // DocumentPaginator 
using System.Windows.Media;         // Visual

namespace MS.Internal.Documents
{ 
    /// 
    /// This is the abstract base class for all paginating layouts. It 
    /// provides default implementations for the asynchronous versions of 
    /// GetPage and ComputePageCount.
    ///  
    internal class FixedDocumentPaginator : DynamicDocumentPaginator, IServiceProvider
    {
        //-------------------------------------------------------------------
        // 
        //  Constructors
        // 
        //------------------------------------------------------------------- 

        #region Constructors 

        /// 
        /// Constructor
        ///  
        internal FixedDocumentPaginator(FixedDocument document)
        { 
            _document = document; 
        }
 
        #endregion Constructors

        //--------------------------------------------------------------------
        // 
        //  Public Methods
        // 
        //------------------------------------------------------------------- 

        #region Public Methods 

        /// 
        /// 
        ///  
        public override DocumentPage GetPage(int pageNumber)
        { 
            return _document.GetPage(pageNumber); 
        }
 
        /// 
        /// 
        /// 
        public override void GetPageAsync(int pageNumber, object userState) 
        {
            _document.GetPageAsync(pageNumber, userState); 
        } 

        ///  
        /// 
        /// 
        public override void CancelAsync(object userState)
        { 
            _document.CancelAsync(userState);
        } 
 
        /// 
        ///  
        /// 
        public override int GetPageNumber(ContentPosition contentPosition)
        {
            return _document.GetPageNumber(contentPosition); 
        }
 
        ///  
        /// 
        ///  
        public override ContentPosition GetPagePosition(DocumentPage page)
        {
            return _document.GetPagePosition(page);
        } 

        ///  
        ///  
        /// 
        public override ContentPosition GetObjectPosition(Object o) 
        {
            return _document.GetObjectPosition(o);
        }
 
        #endregion Public Methods
 
        //-------------------------------------------------------------------- 
        //
        //  Public Properties 
        //
        //--------------------------------------------------------------------

        #region Public Properties 

        ///  
        ///  
        /// 
        public override bool IsPageCountValid 
        {
            get { return _document.IsPageCountValid; }
        }
 
        /// 
        ///  
        ///  
        public override int PageCount
        { 
            get { return _document.PageCount;  }
        }

        ///  
        /// 
        ///  
        public override Size PageSize 
        {
            get { return _document.PageSize; } 
            set { _document.PageSize = value; }
        }

        ///  
        /// 
        ///  
        public override IDocumentPaginatorSource Source 
        {
            get { return _document; } 
        }

        #endregion Public Properties
 
        //-------------------------------------------------------------------
        // 
        //  Internal Methods 
        //
        //-------------------------------------------------------------------- 

        #region Internal Methods

        internal void NotifyGetPageCompleted(GetPageCompletedEventArgs e) 
        {
            OnGetPageCompleted(e); 
        } 

        internal void NotifyPaginationCompleted(EventArgs e) 
        {
            OnPaginationCompleted(e);
        }
 
        internal void NotifyPaginationProgress(PaginationProgressEventArgs e)
        { 
            OnPaginationProgress(e); 
        }
 
        internal void NotifyPagesChanged(PagesChangedEventArgs e)
        {
            OnPagesChanged(e);
        } 

        #endregion Internal Methods 
 
        //-------------------------------------------------------------------
        // 
        //  Private Fields
        //
        //-------------------------------------------------------------------
 
        #region Private Fields
 
        private readonly FixedDocument _document; 

        #endregion Private Fields 

        //-------------------------------------------------------------------
        //
        //  IServiceProvider Members 
        //
        //-------------------------------------------------------------------- 
 
        #region IServiceProvider Members
 
        /// 
        /// Returns service objects associated with this control.
        /// 
        /// Specifies the type of service object to get. 
        object IServiceProvider.GetService(Type serviceType)
        { 
            return ((IServiceProvider)_document).GetService(serviceType); 
        }
 
        #endregion IServiceProvider Members
    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK