add_edit(function(sender, e)) edit.add(function(sender, e)) remove_edit(function(sender, e)) edit.remove(function(sender, e))
When an object is being edited, the automation object will hook the object edit designer's AnnEditDesigner.Edit to this event. Therefore, instead of hooking and unhooking to the various designers edit events, you can simply subscribe to this event once.
The following example will show how to track when an object is edited.
Start with the AnnAutomationManager example, remove all the code inside the example function (search for the // TODO: add example code here comment) and insert the following code:
Click the example button. Now whenever you move or resize an object, you will get the message.
example: function SiteLibrary_DefaultPage$example() { var _this = this; // Hook to the automation's Edit event this._automation.add_edit(function(sender, e) { // e is of type AnnEditDesignerEventArgs if(e.get_operationStatus() == lt.Annotations.Core.AnnDesignerOperationStatus.end) { alert("Object changed..."); } }); },
Parameter | Type | Description |
---|---|---|
sender | 'var' | The source of the event. |
e | AnnEditDesignerEventArgs | The event data. |