CoreUserActivityManager.DeleteUserActivitySessionsInTimeRangeAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Delete user activities created during a specified timeframe.
public:
static IAsyncAction ^ DeleteUserActivitySessionsInTimeRangeAsync(UserActivityChannel ^ channel, DateTime startTime, DateTime endTime);
/// [Windows.Foundation.Metadata.RemoteAsync]
static IAsyncAction DeleteUserActivitySessionsInTimeRangeAsync(UserActivityChannel const& channel, DateTime const& startTime, DateTime const& endTime);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncAction DeleteUserActivitySessionsInTimeRangeAsync(UserActivityChannel channel, System.DateTimeOffset startTime, System.DateTimeOffset endTime);
function deleteUserActivitySessionsInTimeRangeAsync(channel, startTime, endTime)
Public Shared Function DeleteUserActivitySessionsInTimeRangeAsync (channel As UserActivityChannel, startTime As DateTimeOffset, endTime As DateTimeOffset) As IAsyncAction
Parameters
- channel
- UserActivityChannel
The channel that was used to create the user activities.
- startTime
- DateTime DateTimeOffset
The beginning of the time range in which to delete user activities.
- endTime
- DateTime DateTimeOffset
The end of the time range in which to delete user activities.
Returns
An asynchronous action.
- Attributes
Examples
public static async Task DeleteActiviesForDay(DateTime date)
{
var startDate = date.Day;
var endDate = date.Day + TimeSpan.FromDays(1);
await Windows.ApplicationModel.UserActivities.Core.CoreUserActivityManager.DeleteUserActivitySessionsInTimeRangeAsync(UserActivityChannel.GetDefault(), startDate, endDate);
}