예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            int i = int.Parse(textBox3.Text);

            for (int index = 0; index < i; index++)
            {
                QConsumer consumer = consumers[index];

                if (consumer != null)
                {
                    if (textBox_selector.Text.ToString() != "")
                    {
                        consumer.Selector = textBox_selector.Text.ToString();
                    }
                    consumer.Init();
                    consumer.SetTopic();
                    consumer.CreateConsumer();
                }
                else
                {
                    consumer = new QConsumer();
                    if (textBox_selector.Text.ToString() != "")
                    {
                        consumer.Selector = textBox_selector.Text.ToString();
                    }
                    consumers[index] = consumer;
                    consumer.Init();
                    consumer.SetTopic();
                    consumer.CreateConsumer();
                }
            }
        }
예제 #2
0
        private void button7_Click(object sender, EventArgs e)
        {
            int i = int.Parse(textBox3.Text);

            for (int index = 0; index < i; index++)
            {
                QConsumer consumer = consumers[index];
                if (consumer != null)
                {
                    consumer.cleanStart();
                }
            }
        }