currentEditObject Property

Summary

Gets the current AnnObject being edited.

Syntax

JavaScript Syntax
Object.defineProperty(AnnAutomation.prototype, 'currentEditObject', 
	get: function() 
) 
TypeScript Syntax
currentEditObject: AnnObject; // read-only 

Property Value

The current AnnObject being edited; null 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.

You can change the CurrentEditObject by calling SelectObject or SelectObjects.

Example

The following example changes the stroke of the object that is currently being edited to a red stroke that has a length of 2.

JavaScript Example
example: function SiteLibrary_DefaultPage$example() { 
   // check if an object is currently "selected" 
   var currentEditObject = this._automation.get_currentEditObject(); 
   if (currentEditObject != null) 
   { 
      // check if this object supports a stroke 
      if (currentEditObject.get_supportsStroke()) 
      { 
         // change its stroke 
         this._automation.beginUndo(); 
         currentEditObject.set_stroke(lt.Annotations.Core.AnnStroke.create( 
            lt.Annotations.Core.AnnSolidColorBrush.create("blue"), 
            lt.LeadLengthD.create(2))); 
         this._automation.endUndo(); 
         this._automation.invalidate(lt.LeadRectD.get_empty()); 
      } else { 
         alert("This object does not support stroke, select another object"); 
      } 
   } else { 
      alert("Select an object first"); 
   } 
}, 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations.Automation Assembly