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

Cancel Method (AnnAutomation)

Example 





Cancels the operation currently being performed in this AnnAutomation .NET support Silverlight support
Syntax
public virtual void Cancel()
'Declaration
 
Public Overridable Sub Cancel() 
'Usage
 
Dim instance As AnnAutomation
 
instance.Cancel()
public virtual void Cancel()
 function Leadtools.Windows.Annotations.AnnAutomation.Cancel()
public:
virtual void Cancel(); 
Remarks
Cancels any operations currently being performed in this AnnAutomation. An operation can be:
Example
Copy CodeCopy Code  
Private Sub AnnAutomation_Cancel()
   ' subclass to the viewer mouse move event
   ' _automation is an AnnAutomation object
   AddHandler _automation.Container.MouseMove, AddressOf Container_MouseMove
End Sub
Private Sub Container_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
   ' check if we have a draw designer currently selected
   If Not _automation.CurrentDesigner Is Nothing AndAlso TypeOf _automation.CurrentDesigner Is AnnDrawDesigner Then
      ' check if we are over the rectangle 100,100 to 200,200
      Dim rc As Rect = New Rect(100, 100, 100, 100)
      If rc.Contains(e.GetPosition(_automation.Container)) Then
         _automation.Cancel()
      End If
   End If
End Sub
private void AnnAutomation_Cancel()
{
   // subclass to the viewer mouse move event
   // _automation is an AnnAutomation object
   _automation.Container.MouseMove += new MouseEventHandler(Container_MouseMove);
}
private void Container_MouseMove(object sender, MouseEventArgs e)
{
   // check if we have a draw designer currently selected
   if(_automation.CurrentDesigner != null && _automation.CurrentDesigner is AnnDrawDesigner)
   {
      // check if we are over the rectangle 100,100 to 200,200
      Rect rc = new Rect(100, 100, 100, 100);
      if(rc.Contains(e.GetPosition(_automation.Container)))
         _automation.Cancel();
   }
}
private void AnnAutomation_Cancel()
{
   // subclass to the viewer mouse move event
   // _automation is an AnnAutomation object
   _automation.Container.MouseMove += new MouseEventHandler(Container_MouseMove);
}
private void Container_MouseMove(object sender, MouseEventArgs e)
{
   // check if we have a draw designer currently selected
   if(_automation.CurrentDesigner != null && _automation.CurrentDesigner is AnnDrawDesigner)
   {
      // check if we are over the rectangle 100,100 to 200,200
      Rect rc = new Rect(100, 100, 100, 100);
      if(rc.Contains(e.GetPosition(_automation.Container)))
         _automation.Cancel();
   }
}
Private Sub AnnAutomation_Cancel()
   ' subclass to the viewer mouse move event
   ' _automation is an AnnAutomation object
   AddHandler _automation.Container.MouseMove, AddressOf Container_MouseMove
End Sub
Private Sub Container_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
   ' check if we have a draw designer currently selected
   If Not _automation.CurrentDesigner Is Nothing AndAlso TypeOf _automation.CurrentDesigner Is AnnDrawDesigner Then
      ' check if we are over the rectangle 100,100 to 200,200
      Dim rc As Rect = New Rect(100, 100, 100, 100)
      If rc.Contains(e.GetPosition(_automation.Container)) Then
         _automation.Cancel()
      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.