LEADTOOLS Annotations for WPF and Silverlight (Leadtools.Windows.Annotations assembly)
LEAD Technologies, Inc

CurrentEditObject Property

Example 





Gets the current AnnObject being edited. .NET support Silverlight support
Syntax
public AnnObject CurrentEditObject {get;}
'Declaration
 
Public ReadOnly Property CurrentEditObject As AnnObject
'Usage
 
Dim instance As AnnAutomation
Dim value As AnnObject
 
value = instance.CurrentEditObject
public AnnObject CurrentEditObject {get;}
 get_CurrentEditObject(); 
public:
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 CodeCopy Code  
Private Sub AnnAutomation_ChangeStrokeToBlue(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.SupportsStroke Then
         ' change its pen
         automation.BeginUndo()
         automation.CurrentEditObject.Stroke = Colors.Blue
         automation.CurrentEditObject.StrokeThickness = 2.0
         automation.EndUndo()
      End If
   End If
End Sub
private void AnnAutomation_ChangeStrokeToBlue(AnnAutomation automation)
{
   // check if an object is currently "selected"
   if(automation.CurrentEditObject != null)
   {
      // check if this object supports a pen
      if(automation.CurrentEditObject.SupportsStroke)
      {
         // change its pen
         automation.BeginUndo();
         automation.CurrentEditObject.Stroke = Colors.Blue;
         automation.CurrentEditObject.StrokeThickness = 2.0;
         automation.EndUndo();
      }
   }
}
private void AnnAutomation_ChangeStrokeToBlue(AnnAutomation automation)
{
   // check if an object is currently "selected"
   if(automation.CurrentEditObject != null)
   {
      // check if this object supports a pen
      if(automation.CurrentEditObject.SupportsStroke)
      {
         // change its pen
         automation.BeginUndo();
         automation.CurrentEditObject.Stroke = Colors.Blue;
         automation.CurrentEditObject.StrokeThickness = 2.0;
         automation.EndUndo();
      }
   }
}
Private Sub AnnAutomation_ChangeStrokeToBlue(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.SupportsStroke Then
         ' change its pen
         automation.BeginUndo()
         automation.CurrentEditObject.Stroke = Colors.Blue
         automation.CurrentEditObject.StrokeThickness = 2.0
         automation.EndUndo()
      End If
   End If
End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AnnAutomation Class
AnnAutomation Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.