LEADTOOLS Annotations (Leadtools.Annotations assembly)

CurrentEditObject Property

Show in webframe
Example 





Gets the current AnnObject being edited.
Syntax
public virtual AnnObject CurrentEditObject {get;}
'Declaration
 
Public Overridable ReadOnly Property CurrentEditObject As AnnObject
'Usage
 
Dim instance As AnnAutomation
Dim value As AnnObject
 
value = instance.CurrentEditObject

            

            
public:
virtual property AnnObject^ CurrentEditObject {
   AnnObject^ get();
}

Property Value

The current AnnObject being edited; null (Nothing in Visual Basic) if no objects are currently being edited.
Remarks

The current object being edited is the AnnObject currently "selected" where its AnnEditDesigner is currently active.

This is the object that will be processed when calling any of the object processing methods of this AnnAutomation. For example, calling Copy will copy the CurrentEditObject into the clipboard.

You can change the CurrentEditObject by calling StartEditing.

Example
Copy Code  
Imports Leadtools
Imports Leadtools.Annotations
Imports Leadtools.WinForms
Imports Leadtools.Drawing

Public Sub AnnAutomation_ChangePenToBlue(ByVal automation As AnnAutomation)
   ' check if an object is currently "selected"
   If Not automation.CurrentEditObject Is Nothing Then
      ' check if this object supports a pen
      If automation.CurrentEditObject.SupportsPen Then
         ' change its pen
         automation.BeginUndo()
         automation.CurrentEditObject.Pen = New AnnPen(Color.Blue, New AnnLength(2, AnnUnit.Pixel))
         automation.EndUndo()
         automation.Viewer.Invalidate(automation.CurrentEditObject.InvalidRectangle)
      End If
   End If
End Sub
using Leadtools;
using Leadtools.Annotations;
using Leadtools.WinForms;
using Leadtools.Drawing;

public void AnnAutomation_ChangePenToBlue(AnnAutomation automation)
{
   // check if an object is currently "selected"
   if (automation.CurrentEditObject != null)
   {
      // check if this object supports a pen
      if (automation.CurrentEditObject.SupportsPen)
      {
         // change its pen
         automation.BeginUndo();
         automation.CurrentEditObject.Pen = new AnnPen(Color.Blue, new AnnLength(2, AnnUnit.Pixel));
         automation.EndUndo();
         automation.Viewer.Invalidate(automation.CurrentEditObject.InvalidRectangle);
      }
   }
}
Requirements

Target Platforms

See Also

Reference

AnnAutomation Class
AnnAutomation Members

 

 


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