Exemple #1
0
        public Task <TransactionReceipt> RemoveItemRequestAndWaitForReceiptAsync(uint id, CancellationTokenSource cancellationToken = null)
        {
            var removeItemFunction = new RemoveItemFunction();

            removeItemFunction.Id = id;

            return(ContractHandler.SendRequestAndWaitForReceiptAsync(removeItemFunction, cancellationToken));
        }
Exemple #2
0
        public Task <string> RemoveItemRequestAsync(uint id)
        {
            var removeItemFunction = new RemoveItemFunction();

            removeItemFunction.Id = id;

            return(ContractHandler.SendRequestAsync(removeItemFunction));
        }
Exemple #3
0
        public void ShowDialog()
        {
            _dialog.Title = Title;
            ComponentUtils.InsertIconToPanel(_dialog.InfoPanel, AppResources.GetInfoIcon, "Для большей информации об атрибуте, наведите на название этого атрибута");

            _entityList = new GenericEntityListControl <T>(ListTitle, _columnMatcher, DisplayUpdate);
            _dialog.ListPanel.Children.Add(_entityList.GetUiElement());

            foreach (var p in _propertyRows)
            {
                _dialog.PropertiesPanel.Children.Add(p);
            }

            ComponentUtils.InsertIconToButton(_dialog.AddButton, AppResources.GetAddItemIcon, OpenAddNewItemWindowButtonTitle);
            _dialog.AddButton.Click += (sender, args) => DisplayNew();

            _addButton.Click += (sender, args) => {
                if (!AddItemFunction.Invoke())
                {
                    return;
                }
                _entityList.SetSource(UpdateCollectionFunction.Invoke());
                DisplayNew();
            };
            _updateButton.Click += (sender, args) => {
                var selected = _entityList.Selected;
                if (!UpdateItemFunction.Invoke(selected))
                {
                    return;
                }

                var updatedList = UpdateCollectionFunction.Invoke().ToList();
                _entityList.SetSource(updatedList);

                _entityList.Selected = updatedList.First(t => t.Id == selected.Id);
            };
            _removeButton.Click += (sender, args) => {
                if (!RemoveItemFunction.Invoke(_entityList.Selected))
                {
                    return;
                }
                _entityList.SetSource(UpdateCollectionFunction.Invoke());
                DisplayNew();
            };

            _entityList.SetSource(UpdateCollectionFunction.Invoke());

            _dialog.ShowDialog();
        }
Exemple #4
0
 public Task <TransactionReceipt> RemoveItemRequestAndWaitForReceiptAsync(RemoveItemFunction removeItemFunction, CancellationTokenSource cancellationToken = null)
 {
     return(ContractHandler.SendRequestAndWaitForReceiptAsync(removeItemFunction, cancellationToken));
 }
Exemple #5
0
 public Task <string> RemoveItemRequestAsync(RemoveItemFunction removeItemFunction)
 {
     return(ContractHandler.SendRequestAsync(removeItemFunction));
 }