protected override GeneralViewHolder populateHolder(GeneralViewHolder _holder) { SimpleDBItem item = (SimpleDBItem)items[itemPosition]; RecentSearchViewHolder holder = (RecentSearchViewHolder)_holder; if (item != null) { holder.ApplyData(item); } return(holder); }
/// <summary> /// Will delete the passed object. /// </summary> public bool Delete(SimpleDBItem a) { try { _conn.Delete<SimpleDBItem>(a.id); return true; } catch (Exception e) { Debug.WriteLine(e.Message); return false; } }
/// <summary> /// Adds a new item to the list by replacing the existing name /// if it does already exist. Otherwise it will be added as new. /// </summary> public void Add(string key, string value) { SimpleDBItem sdbi = new SimpleDBItem(key, value); for (int i = 0; i < _items.Count; i += 1) { if (_items[i].Key.Equals(key)) { _items[i] = sdbi; break; } } _items.Add(sdbi); }
/// <summary> /// Will delete a single db item from the db. /// </summary> public void Delete(SimpleDBItem sdbi) { _items.Remove(sdbi); DBManager.Static.DBAccessor.Delete(sdbi); }
public void ApplyData(SimpleDBItem item) { Name.Text = item.Value; }