(Leadtools.Annotations.Automation)

FindObjectById Method

Show in webframe
Example 




The id of the AnnAutomationObject to find.
Finds the specified AnnAutomationObject by id.
Syntax
public AnnAutomationObject FindObjectById( 
   int id
)
public AnnAutomationObject FindObjectById( 
   int id
)
-(LTAnnAutomationObject*) findObjectById:(int) anID;
public AnnAutomationObject findObjectById(int id)
 function Leadtools.Annotations.Automation.AnnAutomationManager.FindObjectById( 
   id 
)

Parameters

id
The id of the AnnAutomationObject to find.

Return Value

The AnnAutomationObject for the specified id, or null if no AnnAutomationObject with that id can be found.
Remarks

The possible values for id are:

You can also use FindObject if you have an instance of Leadtools.Annotations.Core.AnnObject and want to find the automation object associated with its type.

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

Example
Copy Code  
using Leadtools.Annotations.Automation;
using Leadtools.Annotations.Core;
using Leadtools.Codecs;
using Leadtools.WinForms;

public void AnnAutomationManager_FindObjectById()
{
   // find the line automation object
   AnnAutomationObject obj = _automation.Manager.FindObjectById(AnnObject.LineObjectId);
   if (obj != null)
   {
      obj.ObjectTemplate.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Blue"), LeadLengthD.Create(2));
   }
}
using Leadtools.Converters;
using Leadtools.Annotations.Automation;
using Leadtools.Controls;
using Leadtools.Annotations.Core;
using Leadtools.Codecs;

[TestMethod]
public void AnnAutomationManager_FindObjectById()
{
   // find the line automation object
   AnnAutomationObject obj = _automation.Manager.FindObjectById(AnnObject.LineObjectId);
   if (obj != null)
   {
      obj.ObjectTemplate.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Blue"), LeadLengthDHelper.Create(2));
   }
}
Requirements

Target Platforms

See Also

Reference

AnnAutomationManager Class
AnnAutomationManager Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.