예제 #1
0
        private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
        {
            if (PrimaryBtnText == "Save")
            {
                try
                {
                    if (!await PocketHandler.Client.ReplaceTags(PocketHandler.CurrentPocketItem, ChipsList.SelectedChips.ToArray())
                        .ConfigureAwait(true))
                    {
                        return;
                    }
                    NotificationHandler.InAppNotification("Tags get updated", 2000);
                    PocketHandler.CurrentPocketItem.Tags =
                        ChipsList.SelectedChips.Select(chip => new PocketTag {
                        Name = chip
                    });
                    Hide();
                }
                catch { }
                return;
            }

            try
            {
                var foo = PocketHandler.Client.Add(new Uri(UrlTextBox.Text.Trim()), ChipsList.SelectedChips.ToArray());
                PocketItem = await foo.ConfigureAwait(true);

                Hide();
            }
            catch { }
        }
예제 #2
0
 public Task<bool> Unarchive(PocketItem item, CancellationToken cancellationToken = new CancellationToken())
 {
     throw new NotImplementedException();
 }
예제 #3
0
 public Task<bool> ReplaceTags(PocketItem item, string[] tags, CancellationToken cancellationToken = new CancellationToken())
 {
     throw new NotImplementedException();
 }
예제 #4
0
 public Task<bool> RenameTag(PocketItem item, string oldTag, string newTag, CancellationToken cancellationToken = new CancellationToken())
 {
     throw new NotImplementedException();
 }
예제 #5
0
 public Task<bool> RemoveTags(PocketItem item, CancellationToken cancellationToken = new CancellationToken())
 {
     throw new NotImplementedException();
 }
예제 #6
0
 /// <summary>
 /// Unarchives the specified item.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="cancellationToken">The cancellation token.</param>
 /// <returns></returns>
 /// <exception cref="PocketException"></exception>
 public async Task<bool> Unarchive(PocketItem item, CancellationToken cancellationToken = default(CancellationToken))
 {
   return await Unarchive(item.ID, cancellationToken);
 }
예제 #7
0
 /// <summary>
 /// Removes a tag from an item.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="tag">The tag.</param>
 /// <param name="cancellationToken">The cancellation token.</param>
 /// <returns></returns>
 /// <exception cref="PocketException"></exception>
 public async Task<bool> RemoveTag(PocketItem item, string tag, CancellationToken cancellationToken = default(CancellationToken))
 {
   return await RemoveTag(item.ID, tag, cancellationToken);
 }
예제 #8
0
 /// <summary>
 /// Adds the specified tags to an item.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="tags">The tags.</param>
 /// <param name="cancellationToken">The cancellation token.</param>
 /// <returns></returns>
 /// <exception cref="PocketException"></exception>
 public async Task<bool> AddTags(PocketItem item, string[] tags, CancellationToken cancellationToken = default(CancellationToken))
 {
   return await AddTags(item.ID, tags, cancellationToken);
 }
예제 #9
0
 /// <summary>
 /// Renames a tag in an item.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="oldTag">The old tag.</param>
 /// <param name="newTag">The new tag name.</param>
 /// <param name="cancellationToken">The cancellation token.</param>
 /// <returns></returns>
 /// <exception cref="PocketException"></exception>
 public async Task<bool> RenameTag(PocketItem item, string oldTag, string newTag, CancellationToken cancellationToken = default(CancellationToken))
 {
   return await RenameTag(item.ID, oldTag, newTag, cancellationToken);
 }