Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.4.6
|
Leadtools.Annotations.Core Namespace > AnnContainer Class : SelectionObject Property |
public AnnSelectionObject SelectionObject {get; set;}
'Declaration
Public Property SelectionObject As AnnSelectionObject
public AnnSelectionObject SelectionObject {get; set;}
@property (nonatomic) LTAnnSelectionObject *selectionObject;
public AnnSelectionObject getSelectionObject() public void setSelectionObject(AnnSelectionObject object)
get_SelectionObject();
set_SelectionObject(value);
Object.defineProperty('SelectionObject');
The selection object is always in the container and contains a collection (AnnSelectionObject.SelectedObjects) that holds references to the objects that are in a selected state. This object is used by the automation framework when multiple objects are selected and when drawing the selection "rectangle".
The style of this selection object can be changed from the default (dark green stroke of length 2) or you can derive your own custom object from AnnSelectionObject and use set it in this property.
The objects inside SelectionObject.SelectedObjects must be objects that already exist in the container, the automation frameworks keep this data in synch, therefore, use the AnnAutomation.SelectObject and AnnAutomation.SelectObjects methods to select and unselect objects from the container.
For more information, refer to the automation section in Programming with LEADTOOLS Annotations and Working with Automated Annotations.
using Leadtools.Annotations.Automation; using Leadtools.Annotations.Core; using Leadtools.Codecs; using Leadtools.Annotations.WinForms; public void AnnContainer_SelectionObject() { // Get the selection object of the container AnnContainer container = _automation.Container; AnnSelectionObject selectionObject = container.SelectionObject; // Change its stroke selectionObject.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Black"), LeadLengthD.Create(1)); Debug.WriteLine("Use the new selection object now"); }
using Leadtools.Converters; using Leadtools.Annotations.Automation; using Leadtools.Controls; using Leadtools.Annotations.Core; using Leadtools.Codecs; public void AnnContainer_SelectionObject() { // Get the selection object of the container AnnContainer container = _automation.Container; AnnSelectionObject selectionObject = container.SelectionObject; // Change its stroke selectionObject.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Black"), LeadLengthDHelper.Create(1)); Debug.WriteLine("Use the new selection object now"); }