protected override void triggerControllerCallback(IPdfControllerCallbackManager controller, PdfViewerException ex)
 {
     controller.OnAnnotationUpdate(ex, new List <int>()
     {
         -1
     });
 }
Beispiel #2
0
 public PdfCanvas(IPdfControllerCallbackManager controller)
 {
     Rotation           = 0;
     _canvasRect        = new PdfSourceRect();
     documentManager    = new PdfDocumentManagerMultithreaded(controller);
     pagesToLoadExactly = new SortedSet <int>();
     newlyLoadedPages   = new SortedSet <int>();
     this.controller    = controller;
     controller.VisiblePageRangeChanged += OnVisiblePageRangeChanged;
     documentManager.PageRectLoaded     += OnPageLoaded;
 }
Beispiel #3
0
 //public abstract void Execute(IPdfDocument document, IPdfControllerCallbackManager controller);
 public virtual void Execute(IPdfDocument document, IPdfControllerCallbackManager controller)
 {
     try
     {
         InOutTuple tuple = new InOutTuple(arguments, ExecuteNative(document, arguments));
         this.completedEvent.TriggerEvent(tuple, null);
         triggerControllerCallback(controller, tuple, null);
     }
     catch (PdfViewerException ex)
     {
         this.completedEvent.TriggerEvent(ex);
         triggerControllerCallback(controller, ex);
     }
 }
 //public abstract void Execute(IPdfDocument document, IPdfControllerCallbackManager controller);
 public override void Execute(IPdfDocument document, IPdfControllerCallbackManager controller)
 {
     try
     {
         if (arguments.loadPageRect)
         {
             PdfGetPageRectRequest request = new PdfGetPageRectRequest(arguments.page);
             request.Execute(document, controller);
             arguments.sourceRect = request.Wait().output;
         }
         InOutTuple tuple = new InOutTuple(arguments, ExecuteNative(document, arguments));
         this.completedEvent.TriggerEvent(tuple, null);
         triggerControllerCallback(controller, tuple, null);
     }
     catch (PdfViewerException ex)
     {
         this.completedEvent.TriggerEvent(ex);
         triggerControllerCallback(controller, ex);
     }
 }
Beispiel #5
0
        public override void Execute(IPdfDocument document, IPdfControllerCallbackManager controller)
        {
            APdfRequest <bool, object> .InOutTuple tuple = new APdfRequest <bool, object> .InOutTuple(this.arguments, null);

            try
            {
                document.Close();
                this.completedEvent.TriggerEvent(tuple, null);
                if (this.arguments)
                {
                    controller.OnCloseCompleted(null);
                }
            }
            catch (PdfViewerException ex)
            {
                this.completedEvent.TriggerEvent(tuple, ex);
                if (this.arguments)
                {
                    controller.OnCloseCompleted(ex);
                }
            }
        }
Beispiel #6
0
        public PdfDocumentManagerMultithreaded(IPdfControllerCallbackManager controller)
        {
            //Utilities.Logger.FileName = @"P:\temp\wpflog.log";
            requestQueue = new SynchronisedGenericPriorityQueue();
            document     = new PdfDocument();
            pageCache    = new AlwaysRememberCache <int, PdfSourceRect, PageCacheParams>(GetPageFromSourceAsync);
            pageCache.FirstLoadParametrizer  = PageCacheFirstLoadParametrizer;
            pageCache.ObjectEquatorDelegate  = PageCacheEquator;
            pageCache.ParametrizationChanger = PageCacheParametrizationChanger;
            pageCache.ChangeParametrization(new PageCacheParams(0, 1.0));
            pageCache.PredictionAlgorithm = PageCachePredictionAlgorithm;
            PageCacheGuessGenerator pageCacheGuessGenerator = new PageCacheGuessGenerator();

            pageCache.GuessGenerator    = pageCacheGuessGenerator;
            textFragmentCache           = new AlwaysRememberCache <int, IList <PdfTextFragment>, Object>(GetTextFragmentsFromSource);
            thumbnailCache              = new AlwaysRememberCache <ThumbnailCacheArgs, WriteableBitmap, Object>(LoadThumbnailFromSource);
            this.controller             = controller;
            controller.RotationChanged += RotationChangedEventHandler;
            controller.ZoomChanged     += ZoomFactorChangedEventHandler;
            rendererWorker              = new Thread(new ThreadStart(WorkerRun));
            rendererWorker.Start();
        }
 protected override void triggerControllerCallback(IPdfControllerCallbackManager controller, PdfViewerException ex)
 {
 }
Beispiel #8
0
 protected override void triggerControllerCallback(IPdfControllerCallbackManager controller, PdfViewerException ex)
 {
     throw new NotImplementedException("This should not be called because APdfRequest.Execute has been overridden");
 }
Beispiel #9
0
 protected override void triggerControllerCallback(IPdfControllerCallbackManager controller, PdfViewerException ex)
 {
     controller.OnOutlinesLoaded(ex, this.arguments, null);
 }
Beispiel #10
0
 protected override void triggerControllerCallback(IPdfControllerCallbackManager controller, InOutTuple tuple, PdfViewerException ex)
 {
     controller.OnOutlinesLoaded(ex, tuple.arguments, tuple.output);
 }
 protected override void triggerControllerCallback(IPdfControllerCallbackManager controller, PdfViewerException ex)
 {
     controller.OnThumbnailLoaded(this.arguments.page, null, ex);
 }
 protected override void triggerControllerCallback(IPdfControllerCallbackManager controller, InOutTuple tuple, PdfViewerException ex)
 {
     controller.OnThumbnailLoaded(tuple.arguments.page, tuple.output, ex);
 }
 protected override void triggerControllerCallback(IPdfControllerCallbackManager controller, InOutTuple tuple, PdfViewerException ex)
 {
     controller.OnAnnotationUpdate(ex, tuple.output);
 }
Beispiel #14
0
 protected override void triggerControllerCallback(IPdfControllerCallbackManager controller, PdfViewerException ex)
 {
     controller?.OnAnnotationsLoaded(ex, null);
 }
Beispiel #15
0
 protected abstract void triggerControllerCallback(IPdfControllerCallbackManager controller, PdfViewerException ex);
 protected override void triggerControllerCallback(IPdfControllerCallbackManager controller, PdfViewerException ex)
 {
     controller.OnDrawCompleted(ex, null);
 }