(Leadtools.Annotations.Automation)

Draw Event

Show in webframe
Example 




Occurs when an AnnObject is being drawn.
Syntax
-(void) automation:(LTAnnAutomation*) automation 
      drawWithArgs:(LTAnnDrawDesignerEventArgs*) e;
            
public void addDrawDesignerdListener(AnnDrawDesignerListener listener)
public void removeDrawDesignerListener(AnnDrawDesignerListener listener)
            
add_Draw(function(sender, e))
remove_Draw(function(sender, e))

Event Data

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

PropertyDescription
Cancel  
Object  
OperationStatus  
Remarks

When an object is being drawn, the automation object will hook the object draw designer's AnnDrawDesigner.Draw to this event. Therefore, instead of hooking and unhooking to the various designers draw 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_Draw()
{
   // Hook to the automation's Draw event
   _automation.Draw += _automation_Draw;
}
void _automation_Draw(object sender, AnnDrawDesignerEventArgs e)
{
   // Check if we are drawing a line and we just started, if so, cancel it
   if (_automation.Manager.CurrentObjectId == AnnObject.LineObjectId &&
      e.OperationStatus == AnnDesignerOperationStatus.Start)
   {
      Debug.WriteLine("Canceling line...");
      e.Cancel = true;
   }
}
using Leadtools.Annotations.Automation;
using Leadtools.Controls;
using Leadtools.Converters;
using Leadtools.Annotations.Core;
using Leadtools.Codecs;

[TestMethod]
public void AnnAutomation_Draw()
{
   // Hook to the automation's Draw event
   _automation.Draw += _automation_Draw;
}
void _automation_Draw(object sender, AnnDrawDesignerEventArgs e)
{
   // Check if we are drawing a line and we just started, if so, cancel it
   if (_automation.Manager.CurrentObjectId == AnnObject.LineObjectId &&
      e.OperationStatus == AnnDesignerOperationStatus.Start)
   {
      Debug.WriteLine("Canceling line...");
      e.Cancel = true;
   }
}
Requirements

Target Platforms

See Also

Reference

AnnAutomation Class
AnnAutomation Members

 

 


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