Beispiel #1
0
        private void sendButton_Click(object sender, EventArgs e)
        {
            try
            {
                product = zf.GetProduct(productTextBox.Text, exchangeComboBox.SelectedItem.ToString());
            }
            catch
            {
                MessageBox.Show("Invalid product " + productTextBox.Text + "." + exchangeComboBox.SelectedItem.ToString());
            }

            ZenFire.OrderArgs args = new ZenFire.OrderArgs();

            args.Account  = (ZenFire.IAccount)accountComboBox.SelectedValue;
            args.Product  = product;
            args.Action   = (ZenFire.Order.Action)actionComboBox.SelectedValue;
            args.Quantity = Decimal.ToInt32(quantitySpinner.Value);
            args.Duration = (ZenFire.Order.Duration)durationComboBox.SelectedValue;
            args.Type     = (ZenFire.Order.Type)typeComboBox.SelectedValue;

            try
            {
                zf.PlaceOrder(args);
            }
            catch
            {
                MessageBox.Show("Failed to send order");
            }
        }