←Select platform

BeforeObjectChanged Event

Summary

Occurs before an AnnObject is about to be changed.

Syntax

C#
VB
C++
public event EventHandler<AnnBeforeObjectChangedEventArgs> BeforeObjectChanged 
  
Public Event BeforeObjectChanged As EventHandler(Of AnnBeforeObjectChangedEventArgs) 
public: 
event EventHandler<AnnBeforeObjectChangedEventArgs^>^ BeforeObjectChanged 

Event Data

The event handler receives an argument of type AnnBeforeObjectChangedEventArgs containing data related to this event. The following AnnBeforeObjectChangedEventArgs properties provide information specific to this event.

PropertyDescription
Cancel Gets or sets a value indicating whether the change should be canceled.
ChangeType Gets the type of change.
Designer Gets the designer responsible for the change.
Objects Gets the objects that have been changed.
Remarks

This event will be fired before an AnnObject is about to be modified by this AnnAutomation.

Example

This example will prevent changing the stroke of all annotation objects.

C#
VB
Silverlight C#
Silverlight VB
using Leadtools.Windows.Controls; 
using Leadtools.Windows.Annotations; 
using Leadtools.Demos; 
using Leadtools.Help; 
 
private void AnnAutomation_BeforeObjectChanged(AnnAutomationManager manager) 
{ 
   // subscribe to the BeforeObjectChanged of all automations 
   foreach (AnnAutomation automation in manager.Automations) 
      automation.BeforeObjectChanged += new EventHandler<AnnBeforeObjectChangedEventArgs>(automation_BeforeObjectChanged); 
} 
 
private void automation_BeforeObjectChanged(object sender, AnnBeforeObjectChangedEventArgs e) 
{ 
   // prevent changing the stroke 
   if (e.ChangeType == AnnObjectChangedType.Stroke) 
      e.Cancel = true; 
} 
Imports Leadtools.Windows.Controls 
Imports Leadtools.Windows.Annotations 
 
Private Sub AnnAutomation_BeforeObjectChanged(ByVal manager As AnnAutomationManager) 
   ' subscribe to the BeforeObjectChanged of all automations 
   For Each automation As AnnAutomation In manager.Automations 
      AddHandler automation.BeforeObjectChanged, AddressOf automation_BeforeObjectChanged 
   Next automation 
End Sub 
 
Private Sub automation_BeforeObjectChanged(ByVal sender As Object, ByVal e As AnnBeforeObjectChangedEventArgs) 
   ' prevent changing the stroke 
   If e.ChangeType = AnnObjectChangedType.Stroke Then 
      e.Cancel = True 
   End If 
End Sub 
using Leadtools.Windows.Controls; 
using Leadtools.Windows.Annotations; 
using Leadtools.Examples; 
using Leadtools.Silverlight.Demos; 
//using Leadtools.Help; 
 
private void AnnAutomation_BeforeObjectChanged(AnnAutomationManager manager) 
{ 
   // subscribe to the BeforeObjectChanged of all automations 
   foreach (AnnAutomation automation in manager.Automations) 
      automation.BeforeObjectChanged += new EventHandler<AnnBeforeObjectChangedEventArgs>(automation_BeforeObjectChanged); 
} 
 
private void automation_BeforeObjectChanged(object sender, AnnBeforeObjectChangedEventArgs e) 
{ 
   // prevent changing the stroke 
   if (e.ChangeType == AnnObjectChangedType.Stroke) 
      e.Cancel = true; 
} 
Imports Leadtools.Windows.Controls 
Imports Leadtools.Windows.Annotations 
Imports Leadtools.Silverlight.Demos 
'using Leadtools.Help; 
 
Private Sub AnnAutomation_BeforeObjectChanged(ByVal manager As AnnAutomationManager) 
   ' subscribe to the BeforeObjectChanged of all automations 
   For Each automation As AnnAutomation In manager.Automations 
      AddHandler automation.BeforeObjectChanged, AddressOf automation_BeforeObjectChanged 
   Next automation 
End Sub 
 
Private Sub automation_BeforeObjectChanged(ByVal sender As Object, ByVal e As AnnBeforeObjectChangedEventArgs) 
   ' prevent changing the stroke 
   If e.ChangeType = AnnObjectChangedType.Stroke Then 
      e.Cancel = True 
   End If 
End Sub 

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.Windows.Annotations Assembly