LEADTOOLS Annotations for WPF and Silverlight (Leadtools.Windows.Annotations assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.31
FindObject Method
See Also 
Leadtools.Windows.Annotations Namespace > AnnAutomationManager Class : FindObject Method



id
The ID of the AnnAutomationObject to find

The FindObject Method supports WPF/Silverlight.

The FindObject Method is available in LEADTOOLS Document and Medical Imaging toolkits.

id
The ID of the AnnAutomationObject to find
Finds the AnnAutomationObject associated with a certain ID. Supported in Silverlight, Windows Phone 7

Syntax

Visual Basic (Declaration) 
Public Function FindObject( _
   ByVal id As Integer _
) As AnnAutomationObject
Visual Basic (Usage)Copy Code
Dim instance As AnnAutomationManager
Dim id As Integer
Dim value As AnnAutomationObject
 
value = instance.FindObject(id)
C# 
public AnnAutomationObject FindObject( 
   int id
)
C++/CLI 
public:
AnnAutomationObject^ FindObject( 
   int id
) 

Parameters

id
The ID of the AnnAutomationObject to find

Return Value

The AnnAutomationObject from AnnAutomationManager.Objects for this ID if found; null (Nothing in Visual Basic) otherwise.

Example

This example changes the line color of new line automation objects to blue.

Visual BasicCopy Code
Private Sub AnnAutomationManager_FindObject(ByVal manager As AnnAutomationManager)
   ' fine the line automation object
   Dim autObj As AnnAutomationObject = manager.FindObject(AnnAutomationManager.LineObjectId)
   If Not autObj Is Nothing Then
      autObj.Object.Stroke = Colors.Blue
      autObj.Object.StrokeThickness = 2.0
   End If
End Sub
C#Copy Code
private void AnnAutomationManager_FindObject(AnnAutomationManager manager)
{
   // fine the line automation object
   AnnAutomationObject autObj = manager.FindObject(AnnAutomationManager.LineObjectId);
   if(autObj != null)
   {
      autObj.Object.Stroke = Colors.Blue;
      autObj.Object.StrokeThickness = 2.0;
   }
}
SilverlightCSharpCopy Code
private void AnnAutomationManager_FindObject(AnnAutomationManager manager)
{
   // fine the line automation object
   AnnAutomationObject autObj = manager.FindObject(AnnAutomationManager.LineObjectId);
   if(autObj != null)
   {
      autObj.Object.Stroke = Colors.Blue;
      autObj.Object.StrokeThickness = 2.0;
   }
}
SilverlightVBCopy Code
Private Sub AnnAutomationManager_FindObject(ByVal manager As AnnAutomationManager)
   ' fine the line automation object
   Dim autObj As AnnAutomationObject = manager.FindObject(AnnAutomationManager.LineObjectId)
   If Not autObj Is Nothing Then
      autObj.Object.Stroke = Colors.Blue
      autObj.Object.StrokeThickness = 2.0
   End If
End Sub

Remarks

This method enumerates all of the AnnAutomationObject items in the AnnAutomationManager.Objects collection and compares AnnAutomationObject.Id with id.

Requirements

Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)

See Also

FindObject requires a Document/Medical product license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features and Unlocking Special LEAD Features.