(Leadtools.Annotations.Automation)

Run Event

Show in webframe
Example 




Occurs when an AnnObject is being run.
Syntax
-(void) automation:(LTAnnAutomation*) automation 
       runWithArgs:(LTAnnRunDesignerEventArgs*) e;
            
public void addRunDesignerListener(AnnRunDesignerListener listener)
public void removeRunDesignerListener(AnnRunDesignerListener listener)
            
add_Run(function(sender, e))
remove_Run(function(sender, e))

Event Data

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

PropertyDescription
Cancel  
Object  
OperationStatus  
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
Copy Code  
using Leadtools.Annotations.Automation;
using Leadtools.Annotations.Core;
using Leadtools.Codecs;
using Leadtools.WinForms;

public void AnnAutomation_Run()
{
   // Switch to run mode
   _automation.Manager.UserMode = AnnUserMode.Run;
   // Hook to the automation's Run event
   _automation.Run += _automation_Run;
}

void _automation_Run(object sender, AnnRunDesignerEventArgs e)
{
   if (e.OperationStatus == AnnDesignerOperationStatus.Start)
   {
      // Get the object being run
      Debug.WriteLine("In run mode, you clicked an object of id " + e.Object.Id);
   }
}
using Leadtools.Annotations.Automation;
using Leadtools.Controls;
using Leadtools.Converters;
using Leadtools.Annotations.Core;
using Leadtools.Codecs;

[TestMethod]
public void AnnAutomation_Run()
{
   // Switch to run mode
   _automation.Manager.UserMode = AnnUserMode.Run;
   // Hook to the automation's Run event
   _automation.Run += _automation_Run;
}

void _automation_Run(object sender, AnnRunDesignerEventArgs e)
{
   if (e.OperationStatus == AnnDesignerOperationStatus.Start)
   {
      // Get the object being run
      Debug.WriteLine("In run mode, you clicked an object of id " + e.Object.Id);
   }
}
Requirements

Target Platforms

See Also

Reference

AnnAutomation Class
AnnAutomation Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.