private void buttonSendMessage_Click(object sender, EventArgs e) { String messageToSend = this.richTextBoxMessageToSend.Text.Trim(); if (messageToSend == "") return; if (isSendingMessage) return; this.buttonSendMessage.Enabled = false; isSendingMessage = true; asyncWorder= new BackgroundWorker(); asyncWorder.DoWork += new DoWorkEventHandler(SendMessageAsync); asyncWorder.RunWorkerCompleted +=new RunWorkerCompletedEventHandler(SendMessageCompleted); frmProgress = new FrmProgress(); asyncWorder.RunWorkerAsync(new object[] { OrdersDataTable, messageToSend }); frmProgress.StartPosition = FormStartPosition.CenterScreen; frmProgress.ShowDialog(this); frmProgress = null; }
private void SyncOrderData() { if (isSyncingData) { return; } this.buttonSyncEbayData.Enabled = false; isSyncingData = true; DateTime startDate = this.dateTimePickerStartTime.Value; DateTime endDate = this.dateTimePickerEndTime.Value; startDate = startDate.ToUniversalTime(); endDate = endDate.ToUniversalTime(); asyncWorder = new BackgroundWorker(); asyncWorder.DoWork += new DoWorkEventHandler(GetDataAsync); asyncWorder.RunWorkerCompleted += new RunWorkerCompletedEventHandler(GetDataCompleted); frmProgress = new FrmProgress(); asyncWorder.RunWorkerAsync(new object[] { startDate, endDate }); frmProgress.StartPosition = FormStartPosition.CenterScreen; frmProgress.ShowDialog(this); frmProgress = null; }
private void buttonSendMessage_Click(object sender, EventArgs e) { String messageToSend = this.richTextBoxMessageToSend.Text.Trim(); if (messageToSend == "") { return; } if (isSendingMessage) { return; } this.buttonSendMessage.Enabled = false; isSendingMessage = true; asyncWorder = new BackgroundWorker(); asyncWorder.DoWork += new DoWorkEventHandler(SendMessageAsync); asyncWorder.RunWorkerCompleted += new RunWorkerCompletedEventHandler(SendMessageCompleted); frmProgress = new FrmProgress(); asyncWorder.RunWorkerAsync(new object[] { OrdersDataTable, messageToSend }); frmProgress.StartPosition = FormStartPosition.CenterScreen; frmProgress.ShowDialog(this); frmProgress = null; } // buttonSendMessage_Click
private void SyncOrderData() { if (isSyncingData) return; this.buttonSyncEbayData.Enabled = false; isSyncingData = true; DateTime startDate = this.dateTimePickerStartTime.Value; DateTime endDate = this.dateTimePickerEndTime.Value; startDate = startDate.ToUniversalTime(); endDate = endDate.ToUniversalTime(); asyncWorder = new BackgroundWorker(); asyncWorder.DoWork += new DoWorkEventHandler(GetDataAsync); asyncWorder.RunWorkerCompleted += new RunWorkerCompletedEventHandler(GetDataCompleted); frmProgress = new FrmProgress(); asyncWorder.RunWorkerAsync(new object[] { startDate, endDate }); frmProgress.StartPosition = FormStartPosition.CenterScreen; frmProgress.ShowDialog(this); frmProgress = null; }