private async Task ApplyDMSNetworkModelDelta() { //// APPLY Delta if (!nmsDeltaResult.HasValue) { this.buttonBrowseLocation.Enabled = true; MessageBox.Show("No data is imported into delta object.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); Logger.LogInformation("No data is imported into delta object."); return; } try { string log = await adapter.ApplyUpdates(nmsDeltaResult.Value); richTextBoxReport.AppendText(log); nmsDeltaResult = new ConditionalValue <Delta>(false, null); buttonApplyDelta.Enabled = false; } catch (Exception e) { MessageBox.Show(string.Format("An error occurred.\n\n{0}", e.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Logger.LogError("An error occurred.", e); } this.buttonBrowseLocation.Enabled = true; }
private void ApplyDMSNetworkModelDelta() { //// APPLY Delta if (nmsDelta != null) { try { string log = adapter.ApplyUpdates(nmsDelta); richTextBoxReport.AppendText(log); nmsDelta = null; buttonApplyDelta.Enabled = (nmsDelta != null); } catch (Exception e) { MessageBox.Show(string.Format("An error occurred.\n\n{0}", e.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Logger.LogError("An error occurred.", e); } } else { MessageBox.Show("No data is imported into delta object.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); Logger.LogInfo("No data is imported into delta object."); } }