Version

CreateNew Method (ScheduleDataConnectorBase)

Creates a new ActivityBase derived instance based on the activityType parameter.
Syntax
'Declaration
 
Protected Friend MustOverride Function CreateNew( _
   ByVal activityType As ActivityType, _
   ByRef errorInfo As DataErrorInfo _
) As ActivityBase
protected internal abstract ActivityBase CreateNew( 
   ActivityType activityType,
   out DataErrorInfo errorInfo
)

Parameters

activityType
Indicates the type of activity to create.
errorInfo
If there's an error this will be set to a new DataErrorInfo object with the error information.

Return Value

A new ActivityBase derived object created according to the activityType parameter.
Remarks

CreateActivity creates a new ActivityBase derived object, like Appointment, Journal, or Task. Which activity type to create is specified by the activityType parameter. Note that the created activity doesn't get commited to the data source until EndEdit(ActivityBase,Boolean) method is called. Also if you wish to not commit the created activity then it is necessary to call CancelEdit(ActivityBase,DataErrorInfo) so the activity object can be properly discarded by the the data connector.

Note: CreateNew method is called by the XamScheduleDataManager to create a new Appointment, Journal, or Task object. This is typically done when the user initiates creation of a new activity in one of the calendar view controls. If the user commits the appointment then EndEdit method is called to commit the activity. If the user cancels the activity creation then CancelEdit method is called to discard the activity object.

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