Coin.CtlSendMoney.OnSend C# (CSharp) Method

OnSend() private method

private OnSend ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
return void
        void OnSend(object sender, RoutedEventArgs e)
        {
            if (FormMain.I.EnsurePassphraseUnlock()) {
                var prevCursor = Cursor;
                Cursor = Cursors.Wait;
                string address = textAddress.Text,
                    comment = textComment.Text;
                try {
                    Wallet.AddRecipient(address, comment);
                } catch (Exception) {
                }
                try {
                    var prov = new NumberFormatInfo();
                    prov.NumberDecimalSeparator = ".";
                    decimal amount = Convert.ToDecimal(textAmount.Text.Replace(',', '.'), prov);
                    Wallet.SendTo(amount, address, comment);
                } finally {
                    Cursor = prevCursor;
                }
                textAmount.Text = "";
                textAddress.Text = "";
                textComment.Text = "";
                MessageBox.Show("The coins were sent successfully");
            }

            if (Send != null)
                Send(this, null);
        }