Gets or sets the AnnGroupObject that contains this AnnObject.
[XmlIgnoreAttribute()]public virtual AnnGroupObject Group { get; set; }
Public Overridable Property Group As Leadtools.Annotations.AnnGroupObject
public:virtual property Leadtools.Annotations.AnnGroupObject^ Group {Leadtools.Annotations.AnnGroupObject^ get();void set ( Leadtools.Annotations.AnnGroupObject^ );}
The AnnGroupObject that contains this AnnObject.
An AnnObject can be part of one AnnGroupObject only at any given time.
When adding or removing objects to or from a group, you do not need to manually set this property to the container value: this operation is performed internally by the LEADTOOLS annotation toolkit. However, you can check the value of this property to determine the group (if any) to which a certain object currently belongs.
This example creates a line, adds it to a group then adds the group to a container while checking the Container and Group property of the object.
using Leadtools;using Leadtools.Annotations;using Leadtools.Codecs;using Leadtools.WinForms;using Leadtools.Drawing;public void AnnObject_Group(){// add an object to the first containerAnnLineObject line = new AnnLineObject();line.Name = "Line1";ShowGroupAndContainer(line);// add it to a groupAnnGroupObject group = new AnnGroupObject();group.Name = "Group1";group.Objects.Add(line);ShowGroupAndContainer(line);// add the group to a containerAnnContainer container = new AnnContainer();container.Name = "Container1";container.Objects.Add(group);ShowGroupAndContainer(line);}private void ShowGroupAndContainer(AnnObject obj){Console.Write("Container: ");if (obj.Container != null)Console.Write(obj.Container.Name);elseConsole.Write("none");Console.Write(", Group: ");if (obj.Group != null)Console.Write(obj.Group.Name);elseConsole.Write("none");Console.WriteLine();}
Imports LeadtoolsImports Leadtools.AnnotationsImports Leadtools.CodecsImports Leadtools.WinFormsImports Leadtools.DrawingPublic Sub AnnObject_Group()' add an object to the first containerDim line As AnnLineObject = New AnnLineObject()line.Name = "Line1"ShowGroupAndContainer(line)' add it to a groupDim group As AnnGroupObject = New AnnGroupObject()group.Name = "Group1"group.Objects.Add(line)ShowGroupAndContainer(line)' add the group to a containerDim container As AnnContainer = New AnnContainer()container.Name = "Container1"container.Objects.Add(group)ShowGroupAndContainer(line)End SubPrivate Sub ShowGroupAndContainer(ByVal obj As AnnObject)Console.Write("Container: ")If Not obj.Container Is Nothing ThenConsole.Write(obj.Container.Name)ElseConsole.Write("none")End IfConsole.Write(", Group: ")If Not obj.Group Is Nothing ThenConsole.Write(obj.Group.Name)ElseConsole.Write("none")End IfConsole.WriteLine()End Sub
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
