public int CurrentObjectId { get; set; }
The current automation object ID. The default value is AnnObject.None
The current automation object ID is the AnnAutomationObject.Id of the AnnAutomationObject currently selected. This object is the "active" object to be drawn on the current active AnnAutomation.
The CurrentObjectIdChanged event is fired when this property is changed.
using Leadtools.Annotations.Automation;
using Leadtools.Annotations.Engine;
using Leadtools.Codecs;
using Leadtools.Controls;
using Leadtools.Annotations.Rendering;
using Leadtools.Annotations.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;
}
}