private ActionResult Modify(PocketAction action) { var actions = new List <PocketAction> { action }; var results = _api.Modify(actions).ToList(); var res = results.Single(); return(res); }
public void AddPocketAction() { var dialog = new ActionInput(); dialog.Closing += (sender, args) => { if (dialog.DataContext is ActionInputViewModel vm && vm.PocketAction.Id > 0) { PocketActions.Add(vm.PocketAction); SelectedPocketAction = vm.PocketAction; } }; dialog.ShowDialogWindow(new ActionInputViewModel(dialog), mWindow); }
public ActionInputViewModel(Window window) : base(window) { mWindow = window; WindowMinimumHeight = 350; WindowMinimumWidth = 500; Title = "Add Pocket Action"; PocketAction = new PocketAction(); CloseCommand = new RelayCommand(p => { SaveAction(); mWindow.Close(); }); AddCategoryCommand = new RelayCommand(p => AddCategory()); LoadPocketCategories(); }
/// <summary> /// Sends an action. /// See: http://getpocket.com/developer/docs/v3/modify /// </summary> /// <param name="action">The action.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns></returns> /// <exception cref="PocketException"></exception> public async Task <bool> SendAction(PocketAction action, CancellationToken cancellationToken = default(CancellationToken)) { return(await Send(new List <PocketAction>() { action }, cancellationToken)); }
private void LoadActions() { using var db = new AppDbContext(); PocketActions = db.PocketActions.ToObservableCollection(); SelectedPocketAction = PocketActions.FirstOrDefault(); }
private async Task SendAction(PocketAction pa) { List<Param> parameters = new List<Param> { new Param("actions", JsonConvert.SerializeObject(new List<PocketAction> {pa})) }; await HandleRequest("send.php", parameters: parameters); }
/// <summary> /// Sends an action /// </summary> /// <param name="actionParameter">The action parameter.</param> /// <returns></returns> internal async Task <bool> Send(PocketAction actionParameter, CancellationToken cancellationToken) { return(await Send(new List <PocketAction>() { actionParameter }, cancellationToken)); }