Beispiel #1
0
        void RefreshScreen(bool change)
        {
            if (string.IsNullOrEmpty(textBox1.Text))
            {
                textBox1.Text = "dummy";
            }
            var path = @".\private$\" + textBox1.Text;

            textBox2.Text = textBox1.Text + "_one";
            textBox3.Text = textBox1.Text + "_two";
            var msgs = MessageQueueMonitor.GetMessagesInQueue(path);

            if (msgs >= 0)
            {
                label5.Text      = "OK (" + msgs + " mensajes)";
                label5.ForeColor = Color.Green;
                button1.Enabled  = change && msgs > 0;
            }
            else
            {
                label5.Text      = "(no existe)";
                label5.ForeColor = Color.Red;
                button1.Enabled  = false;
            }
        }
Beispiel #2
0
 public MainForm()
 {
     InitializeComponent();
     posiciones =
         new MessageQueueMonitor(Config.GetConfigurationString("queues", "posiciones", @".\private$\posiciones"));
     combustible =
         new MessageQueueMonitor(Config.GetConfigurationString("queues", "combustible", @".\private$\combustible"));
 }
Beispiel #3
0
 private void timer2_Tick(object sender, EventArgs e)
 {
     timer2.Stop();
     if (thesourcemon != null)
     {
         thesourcemon.Stop();
         thesourcemon = null;
     }
     thesourcemon = new MessageQueueMonitor(txtQueueName.Text);
     thesourcemon.Start();
 }
Beispiel #4
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            var path = @".\private$\" + textBox1.Text;
            var msgs = MessageQueueMonitor.GetMessagesInQueue(path);

            if (msgs < 1)
            {
                batchConsumer    = null;
                timer1.Enabled   = false;
                textBox1.Enabled = true;
                textBox2.Enabled = true;
                textBox3.Enabled = true;
                button2.Enabled  = true;
                textBox1.Text    = textBox1.Text;
                RefreshScreen(false);
                return;
            }
            RefreshScreen(false);
        }