Version

BeginEditWithCopy Method

Used to make a copy of an activity for the purposes of editing it without affecting the original activity until all the changes need to be committed.
Syntax
'Declaration
 
Public Function BeginEditWithCopy( _
   ByVal activity As ActivityBase, _
   ByVal synchronizeChangesFromOriginalActivity As Boolean, _
   ByRef error As DataErrorInfo _
) As ActivityBase

Parameters

activity
ActivityBase derived object for which a copy will be created.
synchronizeChangesFromOriginalActivity
If true any changes made to the original activity will be applied to the copy that's returned.
error
If there's an error this will be set to a new DataErrorInfo object with the error information.

Return Value

Cloned copy of the specified activity.
Remarks

BeginEditWithCopy method is meant to be used to create a copy of an activity so the copy can be modified without affecting the original activity. It returns a copy of the original activity. When the changes made to the copy need to be committed to the original activity, call EndEdit(ActivityBase,Boolean) method passing to it the clone activity that's returned by this method. Also to cancel and discard the clone activity, you need to call CancelEdit passing it the clone activity.

Note that successive calls to this method without intervening cancel edit or end edit operations on the returned clone will result in the same clone being returned.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also