combit List & Label 29 - .NET Help
combit.Reporting Namespace / PostCloneDesignerObjectEventArgs Class / Clone Property
Example


In This Topic
    Clone Property
    In This Topic
    The cloned Designer object. Custom defined objects/members in the Designer object (e.g. custom lists etc.) can be copied into a new copy of the Designer object with this property.
    Syntax
    'Declaration
     
    
    Public ReadOnly Property Clone As DesignerObject
    public DesignerObject Clone {get;}
    public:
    property DesignerObject^ Clone {
       DesignerObject^ get();
    }
    Example
    class MyDesignerObject : DesignerObject
    {
    	// Custom member variables
    	List<int> _lst = new List<int>();
    	int _currentPrintingLineIndex = -1;
    	bool _lastPage = false;
    	// ...
    	protected override void OnPostCloneDesignerObject(PostCloneDesignerObjectEventArgs e)
    	{
    		MyDesignerObject clone = (MyDesignerObject)e.Clone;
    
    		clone._currentPrintingLineIndex = _currentPrintingLineIndex;
    		clone._lastPage = _lastPage;
    		clone._lst = _lst;
    	}
    	// ...
    }
    Class MyDesignerObject
    	Inherits DesignerObject
    	' Custom member variables
    	Private _lst As New List(Of Integer)()
    	Private _currentPrintingLineIndex As Integer = -1
    	Private _lastPage As Boolean = False
    	' ...
    	Protected Overrides Sub OnPostCloneDesignerObject(e As PostCloneDesignerObjectEventArgs)
    		Dim clone As MyDesignerObject = DirectCast(e.Clone, MyDesignerObject)
    
    		clone._currentPrintingLineIndex = _currentPrintingLineIndex
    		clone._lastPage = _lastPage
    		clone._lst = _lst
    	End Sub
    	' ...
    End Class
    Requirements

    Platforms: Windows 10 (Version 21H2 - 23H2), Windows 11 (21H2 - 22H2), Windows Server 2016 - 2022
    .NET: .NET Framework 4.8, .NET 6, .NET 7, .NET 8

    See Also