//-----------------------------------------------------------------------
//
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
//
// Stubbfel
// 15.10.2013
// Implements the background tasks class
//-----------------------------------------------------------------------
namespace CampusAppWP8ScheduledTaskAgent.Utility
{
using System;
using CampusAppWPortalLib8.Utility;
using Microsoft.Phone.Scheduler;
/// Class provide some static methods for background tasks.
/// Stubbfel, 15.10.2013.
///
public class BackgroundTasks : AbstractBackgroundTasks
{
/// Method stop a certain PerodicTask.
/// Stubbfel, 15.10.2013.
/// name of the task.
public static void StopPerodicTask(string taskName)
{
PeriodicTask periodicTask = ScheduledActionService.Find(taskName) as PeriodicTask;
if (periodicTask != null)
{
try
{
ScheduledActionService.Remove(taskName);
}
catch (Exception e)
{
Logger.LogException(e);
}
}
}
}
}