public void Transform() { InitNextTransform(); var firstIndex = _random.Next(_commands.Count); var secondIndex = _random.Next(_commands.Count); var command = new SwapCommand(_commands, firstIndex, secondIndex); command.Execute(); _swapped=command; }
public void Transform() { InitNextTransform(); var firstIndex = _random.Next(_commands.Count); var secondIndex = _random.Next(_commands.Count); var command = new SwapCommand(_commands, firstIndex, secondIndex); command.Execute(); _swapped = command; }
private async Task ProcessSwapAsync(SwapCommand cmd) { var request = new SwapData { Amount1 = cmd.Amount1, Amount2 = cmd.Amount2, AssetId1 = cmd.Asset1, AssetId2 = cmd.Asset2, Multisig1 = cmd.MultisigCustomer1, Multisig2 = cmd.MultisigCustomer2, TransactionId = cmd.TransactionId }; var response = await _bitcoinApiClient.SwapAsyncTransaction(request); var reqMsg = $"{BitCoinCommands.Swap}:{request.ToJson()}"; await ProcessBitcoinApiResponse(reqMsg, BitCoinCommands.Swap, response, null); }
void SwapElement(double x, double y) { int index = GetIndexFromPoint(x, y); if (index == _draggedIndex || index < 0) { return; } if (index >= Children.Count) { index = Children.Count - 1; } int[] parameter = new int[] { _draggedIndex, index }; if (SwapCommand != null && SwapCommand.CanExecute(parameter)) { SwapCommand.Execute(parameter); _draggedElement = Children[index]; //this is bcause after changing the collection the element is other FillNewDraggedChild(_draggedElement); _draggedIndex = index; } this.InvalidateArrange(); }
public void Undo() { _swapped?.Undo(); _swapped = null; }
private void InitNextTransform() { _swapped = null; }
private void InitNextTransform() { _swapped = null; }
public void Undo() { _swapped?.Undo(); _swapped = null; }