Esempio n. 1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                if (!IsValid())
                {
                    throw new ApplicationException(errorMessage);
                }

                ServiceBusManager.Username = txtUsername.Text;
                ServiceBusManager.Password = txtPassword.Text;
                ServiceBusManager.Start();

                configuration.ConfigurationManager.DoNotShowSettingFormAtStartup();

                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtUsername.Focus();
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Esempio n. 2
0
 public static void Test()
 {
     if (instance == null)
     {
         instance = new ServiceBusManager();
     }
     instance.TestBus();
 }
Esempio n. 3
0
 public static void Start()
 {
     if (instance == null)
     {
         instance = new ServiceBusManager();
     }
     instance.StartBus();
 }
Esempio n. 4
0
 public static void Start()
 {
     if (instance == null)
     {
         instance = new ServiceBusManager();
     }
     instance.StartBus();
 }
Esempio n. 5
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         ServiceBusManager.Stop();
     }
     catch (Exception ex)
     {
         e.Cancel = true;
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Esempio n. 6
0
        private void Test()
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                OrderDbContext dbContext = new OrderDbContext();
                dbContext.Database.Connection.Open();
                dbContext.Database.Connection.Close();

                ServiceBusManager.Test();

                MessageBox.Show("Test OK", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Test Failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
Esempio n. 7
0
 private void StartServiceBus()
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         ServiceBusManager.Start();
         stopImg.Visible     = false;
         startImg.Visible    = true;
         lblStatus.Text      = "Started";
         btnStop.Visible     = true;
         btnStart.Visible    = false;
         lblStatus.ForeColor = Color.Green;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Esempio n. 8
0
 private void StopBus()
 {
     sh.Close();
     instance = null;
 }
Esempio n. 9
0
 public static void Test()
 {
     if (instance == null)
         instance = new ServiceBusManager();
     instance.TestBus();
 }