LEADTOOLS JavaScript (Leadtools)
LEAD Technologies, Inc

AddToEvent Method

Example 
Object containing the event.
String containing the event name.
Event handler method.
Adds a handler to an event.
Syntax
 function Leadtools.LeadEventArgs.addToEvent( 
   obj ,
   eventName ,
   method 
)

Parameters

ParameterTypeDescription
objobjectObject containing the event.
eventNamestringString containing the event name.
methodobjectEvent handler method.
Remarks

To remove the handler from the event, use RemoveFromEvent.

Example
  • JavaScript
  • WinRT C#
      
    Copy CodeCopy Code  
    example: function SiteLibrary_DefaultPage$example(viewer) {
       // The method to call on image changed
       var imageChangedHandler = null;
    
       imageChangedHandler = function(sender, e) {
          alert("Image has changed");
          // Remove the event
          Leadtools.LeadEventArgs.removeFromEvent(viewer, "imageChanged", imageChangedHandler);
       };
    
       // Add a handler to the viewer.ImageChanged event
       Leadtools.LeadEventArgs.addToEvent(viewer, "imageChanged", imageChangedHandler);
    
       // Set an image into the viewer and notice our alert
       viewer.set_imageUrl("Images/24.png");
    },
See Also

Reference

LeadEventArgs Object
LeadEventArgs Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.