LEADTOOLS JavaScript (Leadtools.Annotations.Automation)
LEAD Technologies, Inc

Run Event

Example 
Occurs when an AnnObject is being run.
Syntax
add_run(function(sender, e))
remove_run(function(sender, e))

Remarks

When an object is being run, the automation object will hook the object run designer's AnnRunDesigner.Run to this event. Therefore, instead of hooking and unhooking to the various designers run events, you can simply subscribe to this event once.

Example

This example will show how to track when an object is run.

Start with the AnnAutomationManager example, remove all the code inside the example function (search for the // TODO: add example code here comment) and insert the following code:

Draw a couple of objects and then click the example button. Now you switch into run mode and whenever you click on an object, a message will show.

example: function SiteLibrary_DefaultPage$example() {
   // Switch to run mode
   this._automation.get_manager().set_userMode(Leadtools.Annotations.Core.AnnUserMode.run);
   // Hook to the automation's Run event
   this._automation.add_run(function(sender, e) {
      // e is of type AnnRunDesignerEventArgs

      if(e.get_operationStatus() == Leadtools.Annotations.Core.AnnDesignerOperationStatus.start) {
         // Get the object being run
         alert("In run mode, you clicked an object of id " + e.get_object().get_id());
      }
   });
},
Event Data
Parameter Type Description
sender 'var' The source of the event.
e AnnRunDesignerEventArgs The event data.
See Also

Reference

AnnAutomation Object
AnnAutomation Members

 

 


Products | Support | Contact Us | Copyright Notices

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