private void Projects_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { ClearProject(); if (Projects.SelectedValue == null) return; var projectName = Projects.SelectedValue.ToString(); if (String.IsNullOrEmpty(projectName)) return; Schemas.ItemsSource = null; Tables.ItemsSource = null; _currentProject = _solution.GetProject(projectName); if (string.IsNullOrEmpty(_currentProject.GetScript(ScriptType.PostDeploy))) { MessageBox.Show( "The project needs a post deploy script - add one anywhere in the project and refresh", "MergeUi"); return; } Schemas.ItemsSource = _currentProject.GetSchemas(); }
private void Projects_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { try { if (null == Projects.SelectedValue) return; var projectName = Projects.SelectedValue.ToString(); if (String.IsNullOrEmpty(projectName)) return; Schemas.ItemsSource = null; Tables.ItemsSource = null; _currentProject = _solution.GetProject(projectName); if (string.IsNullOrEmpty(_currentProject.GetScript(ScriptType.PreDeploy)) && string.IsNullOrEmpty(_currentProject.GetScript(ScriptType.PostDeploy))) { MessageBox.Show( "The project needs a post deploy script - add one anywhere in the project and refresh", "MergeUi"); return; } LastBuildTime.Text = string.Format("Last Dacpac Build Time: {0}", _currentProject.GetLastBuildTime()); Schemas.ItemsSource = _currentProject.GetSchemas(); } catch (Exception ex) { Dispatcher.Invoke(() => { LastStatusMessage.Text = "Error see output window "; }); OutputWindowMessage.WriteMessage("Error reading project: {0}", ex.Message); } }