Ticket T825872
Visible to All Users

How to Clone an Object Example

created 5 years ago

Having a hard time finding a current example on how to clone an object.  Could you point me toward a relevant and currently example either in the KB or sample projects.

Answers approved by DevExpress Support

created 5 years ago

Hi,

XAF already provides the Clone Object module for this task. If you wish to clone an object in your code, you can use our Cloner helper class as illustrated in the CloneObjectViewController.CustomCloneObject Event article. If the logic of this helper class does not completely meet your requirements, I suggest you check how this class is implemented in the C:\Program Files (x86)\DevExpress 19.1\Components\Sources\DevExpress.Persistent\DevExpress.Persistent.BaseImpl\Cloner.cs file and implement your class in a similar way.

    Comments (1)
    DK DK
    DataWerkes - Keith 5 years ago

      Thanks.  Very easy to figure out when I stopped looking for something complicated.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.