コード例 #1
0
		public async Task<bool> MarkAs (ShoppingListItem item, bool mark)
		{
			if ( !IsLoggedIn || item.Id == 0 ) { return false; }

			item.Checked = mark;

			string url = ITEM_URL + item.Id;
			HttpResponseMessage response = await client.PutAsJsonAsync<ShoppingListItem> (url, item);
			ShoppingListItem modified = await response.Content.ReadAsAsync<ShoppingListItem> ();

			return modified.Checked == mark;
		}
コード例 #2
0
		public Task<bool> MarkAsNotDone (ShoppingListItem item)
		{
			return MarkAs (item, false);
		}
コード例 #3
0
		public Task<bool> MarkAsDone (ShoppingListItem item)
		{
			return MarkAs (item, true);
		}