private async Task RefreshPropertiesAsync() { try { IsBusy = true; var result = await _searchService.FindProperties(_navigationParams.location, _navigationParams.toLet); _currentPage = result.MetaData.PageNumber; _hasNextPage = result.MetaData.HasNextPage; _total = result.MetaData.TotalItemCount; PropertiesList.Clear(); foreach (var property in result.Properties) { PropertiesList.Add(property); } UpdateDisplyingDescription(); if (_isInitialised == false) { _isInitialised = true; } } catch (Exception exc) { _log.ErrorException("An error has occurred while trying to get search results", exc); await _useDialogs.AlertAsync("An error has occurred. Please try again."); } finally { IsBusy = false; } }
private async Task LoadMorePropertiesAsync(SearchPropertyResult searchPropertyResult) { if (searchPropertyResult == null) { return; } if (PropertiesList[PropertiesList.Count - 1] == searchPropertyResult && _hasNextPage) { await Task.Delay(1000);//Only required to be able to view ActivityIndicator in the footer. LoadingNextPage = true; } if (LoadingNextPage == true) { var result = await _searchService.FindProperties(_locationPrompt, _toLet, _currentPage + 1); _currentPage = result.MetaData.PageNumber; _hasNextPage = result.MetaData.HasNextPage; foreach (var property in result.Properties) { PropertiesList.Add(property); } UpdateDisplyingDescription(); LoadingNextPage = false; } }
public void AddProperty(string key, PropertyInfoEx newProp) { var newIndex = PropertiesList.Count; newProp.propertyPositionIndex = (short)newIndex; PropertiesList.Add(newProp); this.Add(key, newIndex); }
private void Form2_Load(object sender, EventArgs e) { listContact.Clear(); Contact newContact = null; newContact = new Contact(); newContact.Name = "diana"; newContact.Address = "en"; listContact.Add(newContact); newContact = null; newContact = new Contact(); newContact.Name = "maxim"; newContact.Address = "cand"; listContact.Add(newContact); propGrid.AllowDrop = true; object[] itens = new object[2]; itens[0] = listContact; itens[1] = newContact; propGrid.SelectedObject = listContact; this.Controls.Add(propGrid); propGrid.Dock = DockStyle.Fill; }
public void AddProperty(Property p) { if (PropertyById.ContainsKey(p.ID)) { throw new InvalidOperationException(String.Format("Property with ID={0} already exists", p.ID)); } if (PropertyByCompactId.ContainsKey(p.CompactID)) { throw new InvalidOperationException(String.Format("Property with CompactID={0} already exists", p.ID)); } PropertyById[p.ID] = p; PropertyByCompactId[p.CompactID] = p; PropertiesList.Add(p); p.Schema = this; }
private async Task LoadMorePropertiesAsync(SearchPropertyResult searchPropertyResult) { if (searchPropertyResult == null) { return; } if (PropertiesList[PropertiesList.Count - 1] == searchPropertyResult) { if (_hasNextPage) { try { IsBusy = true; var result = await _searchService.FindProperties(_navigationParams.location, _navigationParams.toLet, _currentPage + 1); _currentPage = result.MetaData.PageNumber; _hasNextPage = result.MetaData.HasNextPage; _total = result.MetaData.TotalItemCount; foreach (var property in result.Properties) { PropertiesList.Add(property); } UpdateDisplyingDescription(); } catch (Exception exc) { _log.ErrorException("An error has occurred while trying to get more results", exc); await _useDialogs.AlertAsync("An error has occurred. Please try again."); } finally { IsBusy = false; } } } }