private void tsbPublishEntity_Click(object sender, EventArgs e) { if (lvEntities.SelectedItems.Count > 0) { tsbPublishEntity.Enabled = false; tsbPublishAll.Enabled = false; tsbLoadEntities.Enabled = false; CommonDelegates.SetCursor(this, Cursors.WaitCursor); informationPanel = InformationPanel.GetInformationPanel(this, "Publishing entity...", 340, 120); var bwPublish = new BackgroundWorker(); bwPublish.DoWork += BwPublishDoWork; bwPublish.RunWorkerCompleted += BwPublishRunWorkerCompleted; bwPublish.RunWorkerAsync(lvEntities.SelectedItems[0].Text); } }
private void BwPublishRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { CommonDelegates.SetCursor(this, Cursors.Default); //Cursor = Cursors.Default; if (e.Error != null) { string errorMessage = CrmExceptionHelper.GetErrorMessage(e.Error, false); MessageBox.Show(this, errorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } Controls.Remove(informationPanel); tsbPublishEntity.Enabled = true; tsbPublishAll.Enabled = true; tsbLoadEntities.Enabled = true; }
private void BwFillEntitiesRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Error != null) { string errorMessage = CrmExceptionHelper.GetErrorMessage(e.Error, true); CommonDelegates.DisplayMessageBox(ParentForm, errorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { gbEntities.Enabled = true; tsbPublishEntity.Enabled = true; tsbPublishAll.Enabled = true; } Controls.Remove(informationPanel); CommonDelegates.SetCursor(this, Cursors.Default); }
private void LoadEntities() { lvEntities.Items.Clear(); gbEntities.Enabled = false; tsbPublishEntity.Enabled = false; tsbPublishAll.Enabled = false; lvSourceViews.Items.Clear(); lvSourceViewLayoutPreview.Columns.Clear(); CommonDelegates.SetCursor(this, Cursors.WaitCursor); informationPanel = InformationPanel.GetInformationPanel(this, "Loading entities...", 340, 120); var bwFillEntities = new BackgroundWorker(); bwFillEntities.DoWork += BwFillEntitiesDoWork; bwFillEntities.RunWorkerCompleted += BwFillEntitiesRunWorkerCompleted; bwFillEntities.RunWorkerAsync(); }
private void BwTransferViewsWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { CommonDelegates.SetCursor(this, Cursors.Default); Controls.Remove(informationPanel); if (e.Result == null) { return; } if (((List <Tuple <string, string> >)e.Result).Count > 0) { var errorDialog = new ErrorList((List <Tuple <string, string> >)e.Result); errorDialog.ShowDialog(); } else { MessageBox.Show("Selected views have been successfully transfered!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void tsbTransferViews_Click(object sender, EventArgs e) { if (service == null || targetService == null) { MessageBox.Show("You must select both a source and a target environment.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (lvSourceViews.SelectedItems.Count == 0) { MessageBox.Show("You must select at least one view to be transfered in the right list.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } CommonDelegates.SetCursor(this, Cursors.WaitCursor); var bwTransferViews = new BackgroundWorker(); bwTransferViews.DoWork += BwTransferViewsDoWork; bwTransferViews.RunWorkerCompleted += BwTransferViewsWorkerCompleted; bwTransferViews.RunWorkerAsync(); }
private void BwDisplayViewRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { lvSourceViews.SelectedIndexChanged += lvSourceViews_SelectedIndexChanged; lvSourceViews.Enabled = true; CommonDelegates.SetCursor(this, Cursors.Default); }