Exemple #1
0
        private async Task ExecuteLoadPoofsCommand()
        {
            if (IsBusy || !(await LoginAsync()))
            {
                return;
            }

            HockeyApp.MetricsManager.TrackEvent("Laod Poofs");

            try
            {
                LoadingMessage = "Loading Poofs...";
                IsBusy         = true;
                var poofs = await azureService.GetPoofs(true);

                //var poofs = new List<Model.Poof>()
                //{
                //    new Model.Poof { Justified = true, Comment = "ciao ciao", DateUtc = DateTime.UtcNow},
                //    new Model.Poof { Justified = false, Comment = "ciao1 ciao1 ciao questo è un commento lungo lungo lungo ciao1 ciao1 ciao questo è un commento lungo lungo lungo", DateUtc = DateTime.UtcNow},
                //    new Model.Poof { Justified = false, Comment = "cavolo", DateUtc = DateTime.UtcNow.AddDays(-1)},
                //    new Model.Poof { Justified = false, Comment = "pasticcio", DateUtc = DateTime.UtcNow.AddDays(-2)},
                //    new Model.Poof { Justified = true, Comment = "ok", DateUtc = DateTime.UtcNow.AddDays(-3)}
                //};

                Poofs.ReplaceRange(poofs);

                FilterPoofs();

                SortPoofs();
            }
            catch (Exception ex)
            {
                Insights.Report(ex, Insights.Severity.Error);
                await CoreMethods.DisplayAlert("Sync Error", "Unable to sync Poofs, you may be offline", "OK");
            }
            finally
            {
                IsBusy = false;
            }
        }