public async void Run(IBackgroundTaskInstance taskInstance)
        {

            BackgroundTaskDeferral _deferral = taskInstance.GetDeferral();
            try
            {
                IStorageService storage = new StorageService();
                if (storage.LoadLastUser())
                {
                    DpLogic dpLogic = new DpLogic();
                    ToastLogic toastLogic = new ToastLogic();

                    var notifications = await dpLogic.GetNotifications();

                    //toastLogic.ShowToast(notifications.First(), false);

                    notifications = storage.SaveNotifications(notifications);

                    notifications.ForEach(x => toastLogic.ShowToast(x, false));


                }
            }
            catch (Exception)
            {

            }
            finally
            {
                _deferral.Complete();
            }
        }
Пример #2
0
 public static void SetupTests(TestContext testContext)
 {
     _testContext = testContext;
     logic = new DpLogic();
 }
Пример #3
0
 public DataService(IStorageService storageService)
 {
     _dpLogic = new DpLogic();
     _storageService = storageService;
 }