Leadtools.Annotations Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
Clone Method
See Also  Example
Leadtools.Annotations Namespace > AnnObject Class : Clone Method




Creates an exact copy of this AnnObject object.

Syntax

Visual Basic (Declaration) 
Public Overridable Function Clone() As Object
Visual Basic (Usage)Copy Code
Dim instance As AnnObject
Dim value As Object
 
value = instance.Clone()
C# 
public virtual object Clone()
Managed Extensions for C++ 
public: virtual Object* Clone(); 
C++/CLI 
public:
virtual Object^ Clone(); 

Return Value

The AnnObject object that this class creates.

Example

This example copies the objects from one container to another.

Visual BasicCopy Code
Public Sub AnnObject_Clone(ByVal srcContainer As AnnContainer, ByVal destContainer As AnnContainer)
   ' first remove all objects from the destination container
   destContainer.Objects.Clear()
   ' copy the objects from the src to the destination container
   For Each srcObj As AnnObject In srcContainer.Objects
      ' we want to keep the original object intact, so create an exact copy by cloning the object
      Dim destObj As AnnObject = CType(IIf(TypeOf srcObj.Clone() Is AnnObject, srcObj.Clone(), Nothing), AnnObject)
      destContainer.Objects.Add(destObj)
   Next srcObj
End Sub
C#Copy Code
public void AnnObject_Clone(AnnContainer srcContainer, AnnContainer destContainer) 

   // first remove all objects from the destination container 
   destContainer.Objects.Clear(); 
   // copy the objects from the src to the destination container 
   foreach(AnnObject srcObj in srcContainer.Objects) 
   { 
      // we want to keep the original object intact, so create an exact copy by cloning the object 
      AnnObject destObj = srcObj.Clone() as AnnObject; 
      destContainer.Objects.Add(destObj); 
   } 
}

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Leadtools.Annotations requires a Document or Medical toolkit license and unlock key. For more information, refer to: Raster Pro/Document/Medical Features