void RemoteDataServiceDataFailed(object sender, DataError e) { DateTime lastDate; DateTime.TryParse(StorageService.Instance.UpdatedDate, out lastDate); UpdatingError?.Invoke(this, new DataFailedArgs(e, lastDate)); }
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); } }