private void ValidateToField(IValidationErrors errors) { if (!string.IsNullOrWhiteSpace(To) && !AddressStringParser.TryParse(To, _owner.Wallet.Network, out BitcoinUrlBuilder? url)) { errors.Add(ErrorSeverity.Error, "Input a valid BTC address or URL."); } }
private bool TryParseUrl(string text) { bool result = false; var wallet = _owner.Wallet; if (AddressStringParser.TryParse(text, wallet.Network, out BitcoinUrlBuilder? url)) { result = true; SmartLabel label = url.Label; if (!label.IsEmpty) { //LabelSuggestion.Label = label; } if (url.Address is { })
private bool TryParseUrl(string text) { bool result = false; var wallet = _owner.Wallet; if (AddressStringParser.TryParse(text, wallet.Network, out BitcoinUrlBuilder? url)) { result = true; SmartLabel label = url.Label; if (!label.IsEmpty) { Labels.Clear(); foreach (var labelString in label.Labels) { Labels.Add(labelString); } } if (url.Address is { })