/// <summary>
        /// Dispose the object.
        /// </summary>
        protected void Dispose()
        {
            if (!_disposed)
            {
                _disposed = true;

                // Cleanup all state associated with Paginator.
                if (_documentPaginator != null)
                {
                    _documentPaginator.GetPageCompleted -= new GetPageCompletedEventHandler(HandleGetPageCompleted);
                    _documentPaginator.PagesChanged -= new PagesChangedEventHandler(HandlePagesChanged);
                    _documentPaginator.CancelAsync(this);
                    DisposeCurrentPage();
                    DisposeAsyncPage();
                }
                Invariant.Assert(_documentPage == null);
                Invariant.Assert(_documentPageAsync == null);
                _documentPaginator = null;
                _textView = null;
            }
        }
示例#2
0
 /// <summary>
 /// Cancel async.
 /// </summary>
 /// <param name="userState">The user state.</param>
 public override void CancelAsync(object userState)
 {
     flowDocPaginator.CancelAsync(userState);
 }