Beispiel #1
0
 /// <summary>
 /// Registers the TrafficMonitor background task.
 /// </summary>
 public static void RegisterTrafficMonitor()
 {
     BackgroundTaskHelper.RegisterBackgroundTask(
         taskEntryPoint: "TrafficMonitor.TrafficMonitor",
         taskName: "TrafficMonitor",
         trigger: new MaintenanceTrigger(freshnessTime: 15, oneShot: false),
         condition: new SystemCondition(SystemConditionType.InternetAvailable));
 }
Beispiel #2
0
 /// <summary>
 /// Method which registers a new background task for the app.
 /// Registers a new backgroud task which will be triggered every 15 minutes.
 /// </summary>
 public static void Register()
 {
     Unregister();
     try
     {
         BackgroundTaskHelper.Register(TASK_NAME, ENTRY_POINT, new TimeTrigger(15, false), true, true);
     }
     catch (Exception ex)
     {
         Analytics.TrackEvent(ex.Message, new Dictionary <string, string> {
             { "exception", ex.ToString() }
         });
     }
 }
Beispiel #3
0
 /// <summary>
 /// Unregisters the TrafficMonitor background task.
 /// </summary>
 public static void UnregisterTrafficMonitor()
 {
     BackgroundTaskHelper.UnregisterBackgroundTask("TrafficMonitor");
 }
Beispiel #4
0
 /// <summary>
 /// Method which unregisters the TASK_NAME task of the app.
 /// </summary>
 public static void Unregister()
 {
     BackgroundTaskHelper.Unregister(TASK_NAME);
 }