Error processing SSI file
LEADTOOLS Leadtools.Documents.UI (Leadtools.Documents.UI assembly)

Show in webframe

Operation Event






Occurs when an operation is invoked inside this document viewer.
Syntax
'Declaration
 
Public Event Operation As EventHandler(Of DocumentViewerOperationEventArgs)
'Usage
 
Dim instance As DocumentViewer
Dim handler As EventHandler(Of DocumentViewerOperationEventArgs)
 
AddHandler instance.Operation, handler
Event Data

The event handler receives an argument of type DocumentViewerOperationEventArgs containing data related to this event. The following DocumentViewerOperationEventArgs properties provide information specific to this event.

PropertyDescription
Abort Indicates whether this operation should be aborted.
Data1 The first optional generic data object associated with this operation.
Data2 The second optional generic data object associated with this operation.
Error The exception object if an error occurred while running this operation
IsPostOperation A value that indicate whether the event is fired after the operation is run.
Operation The operation type.
PageNumber The optional page number associated with this operation.
Remarks

The Operation event occurs anytime the document viewer is performing an operation. Such as when rendering the place holder of a page on the View, when a new annotation object is added, and so forth.

Each Operation event fires twice, first with the value of DocumentViewerOperationEventArgs.IsPostOperation set to false to indicate that the operation is about to happen. Then with DocumentViewerOperationEventArgs.IsPostOperation set to true to indicate that the operation is completed.

The operation type is stored in Operation. When IsPostOperation is false, some operations allow the user to change the behavior or abort the operation.

Refer to Document Viewer Operations for a detailed list of all document viewer operations.

DocumentViewerOperationEventArgs
Example

Start with the example created in DocumentViewer, remove all the code in the Example function and add the code below.

When the user clicks the example button, we will intercept when the user clicks on a link in the page and show a message box.

Copy Code  
Imports Leadtools
Imports Leadtools.Controls
Imports Leadtools.Documents
Imports Leadtools.Documents.UI
Imports Leadtools.Codecs
Imports Leadtools.Caching
Imports Leadtools.Annotations.Core
Imports Leadtools.Forms.Ocr

' Disable the example button, this should only run once
exampleButton.Enabled = False
AddHandler _documentViewer.Operation,
   Sub(sender, e)
      If e.Operation = DocumentViewerOperation.RunLink AndAlso Not e.IsPostOperation Then
         Dim link As DocumentLink = CType(e.Data1, DocumentLink)
         MessageBox.Show("Linked at specified location clicked and ignored: " + link.Bounds.ToString())
         e.Abort = True
      End If
   End Sub
using Leadtools;
using Leadtools.Controls;
using Leadtools.Documents;
using Leadtools.Documents.UI;
using Leadtools.Codecs;
using Leadtools.Caching;
using Leadtools.Annotations.Core;
using Leadtools.Forms.Ocr;

// Disable the example button, this should only run once
exampleButton.Enabled = false;
_documentViewer.Operation += (sender, e) =>
{
   if (e.Operation == DocumentViewerOperation.RunLink && !e.IsPostOperation)
   {
      var link = (DocumentLink)e.Data1 ;
      MessageBox.Show("Linked at specified location clicked and ignored: " + link.Bounds.ToString());
      e.Abort = true;
   }
};
Requirements

Target Platforms

See Also

Reference

DocumentViewer Class
DocumentViewer Members
Document Viewer Commands

Error processing SSI file
Leadtools.Documents.UI requires a Document or Medical toolkit license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features