Ejemplo n.º 1
0
        void RemoteDataServiceDataFailed(object sender, DataError e)
        {
            DateTime lastDate;

            DateTime.TryParse(StorageService.Instance.UpdatedDate, out lastDate);

            UpdatingError?.Invoke(this, new DataFailedArgs(e, lastDate));
        }
Ejemplo n.º 2
0
        void RemoteDataServiceDataLoaded(object sender, string e)
        {
            ServiceRoot rootData = null;

            try
            {
                rootData = JsonConvert.DeserializeObject <ServiceRoot>(e);
            }catch
            {
                DateTime lastDate;
                DateTime.TryParse(StorageService.Instance.UpdatedDate, out lastDate);

                UpdatingError?.Invoke(this, new DataFailedArgs(DataError.DataException, lastDate));
            }

            if (rootData != null)
            {
                StorageService.Instance.ServiceData = e;
                StorageService.Instance.UpdatedDate = DateTime.Now.ToString();

                DataUpdated?.Invoke(this, rootData);
            }
        }