run Event

Summary

Occurs when an AnnObject is being run.

Syntax

JavaScript Syntax
Object.defineProperty(AnnAutomation.prototype,'run',  
	get: function(), 
	set: function(value) 
) 
function run.add(function(sender, e)); 
function run.remove(function(sender, e)); 
TypeScript Syntax
run: void; 

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

The following 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.

JavaScript Example
example: function SiteLibrary_DefaultPage$example() { 
   // Switch to run mode 
   this._automation.get_manager().set_userMode(lt.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() == lt.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
ParameterTypeDescription
sendervarThe source of the event.
eAnnRunDesignerEventArgsThe event data.
Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations.Automation Assembly