Share via


CoreUserActivityManager.DeleteUserActivitySessionsInTimeRangeAsync Method

Definition

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);
}

Applies to