'Declaration Public Overridable Function CreateNew( _ ByVal activityType As ActivityType, _ ByRef errorInfo As DataErrorInfo _ ) As ActivityBase
public virtual ActivityBase CreateNew( ActivityType activityType, out DataErrorInfo errorInfo )
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 schedule data connector.
Note: CreateNew method is called 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.
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