public OnDiskMergeRepository(DacParserBuilder dacParserBuilder, VsProject project) { _dacParserBuilder = dacParserBuilder; _project = project; BuildScriptGateways(); }
public ITable GetDescriptor(string filePath, VsProject project) { var fileContent = File.ReadAllText(filePath); var name = (_merge.MergeSpecification.Target as NamedTableReference).SchemaObject.BaseIdentifier.Value; var schemaName = (_merge.MergeSpecification.Target as NamedTableReference).SchemaObject.SchemaIdentifier.Value; var table = project.GetTable(schemaName, name); table.Merge.MergeStatement = _merge; table.Merge.ScriptLength = _merge.FragmentLength; table.Merge.ScriptOffset = _merge.StartOffset; table.Merge.OriginalScript = fileContent.Substring(_merge.StartOffset, _merge.FragmentLength); table.Merge.File = filePath; table.Data = new DataTable(table.Name); FillDataTableFromMerge(table); return table; }
public ScriptParser(string path, VsProject project) { _path = path; _project = project; }
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(); }
public ScriptFileGateway(VsProject project, string path) { _project = project; _path = path; }
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); } }