示例#1
0
        public override async Task InitializeAsync()
        {
            IEnumerable <SynchedPhysicalContacts> contacts = null;

            try
            {
                //pull from cache
                contacts = await BlobCache.UserAccount.GetObject <IEnumerable <SynchedPhysicalContacts> >(CacheKeys.User_phyContacts);
            }
            catch (KeyNotFoundException ex)
            {
                //.LogInformation($"AuthenticationService::LoginAsync() Failed to retrieve authmodel from cache.");
            }

            if (contacts == null || contacts.Count() < 1)
            {
                await Xamarin.Essentials.MainThread.InvokeOnMainThreadAsync(() => {
                    this.OnDataReady(this, new EventArgs());
                });

                return;
            }

            foreach (var item in contacts)
            {
                PhysicalContactsTrackings.Add(item);
            }

            await Xamarin.Essentials.MainThread.InvokeOnMainThreadAsync(() => {
                this.OnDataReady(this, new EventArgs());
            });
        }
示例#2
0
        private void CreateDummy()
        {
            PhysicalContactsTrackings.Add(new SynchedPhysicalContacts
            {
                Contacts   = Backend.Core.Types.PhysicalContacts.Family_GrandFather,
                DateTime   = System.DateTime.Now.AddHours(5),
                StepStatus = Syncfusion.XForms.ProgressBar.StepStatus.Completed
            });


            PhysicalContactsTrackings.Add(new SynchedPhysicalContacts
            {
                Contacts   = Backend.Core.Types.PhysicalContacts.Family_GrandFather,
                DateTime   = System.DateTime.Now.AddDays(10),
                StepStatus = Syncfusion.XForms.ProgressBar.StepStatus.NotStarted
            });


            PhysicalContactsTrackings.Add(new SynchedPhysicalContacts
            {
                Contacts   = Backend.Core.Types.PhysicalContacts.Family_GrandFather,
                DateTime   = System.DateTime.Now,
                StepStatus = Syncfusion.XForms.ProgressBar.StepStatus.InProgress
            });
        }
示例#3
0
        public async Task <SynchedPhysicalContacts> AddContact(PhysicalContacts contact, DateTime date, string Longitude, string Latitude)
        {
            var newContact = new SynchedPhysicalContacts {
                Contacts = contact, DateTime = date, Latitude = Latitude, Longiture = Longitude, StepStatus = Syncfusion.XForms.ProgressBar.StepStatus.InProgress
            };

            PhysicalContactsTrackings.Add(newContact);


            await Xamarin.Essentials.MainThread.InvokeOnMainThreadAsync(() => {
                this.OnDataReady(this, new EventArgs());
            });

            return(newContact);
        }