public ImportDialog() { Telemetry.TrackPageView(nameof(ImportDialog)); InitializeComponent(); Background = VsThemes.GetWindowBackground(); SaveButton.IsEnabled = false; }
private void SqlEditorWindow_Loaded(object sender, RoutedEventArgs e) { try { var overflowGrid = toolBar1.Template.FindName("OverflowGrid", toolBar1) as FrameworkElement; if (overflowGrid != null) { overflowGrid.Visibility = Visibility.Collapsed; } SetEditorFont(); toolBar1.Background = toolTray.Background = VsThemes.GetCommandBackground(); dock1.Background = VsThemes.GetWindowBackground(); sep4.Background = VsThemes.GetToolbarSeparatorBackground(); txtSaveAs.Foreground = VsThemes.GetWindowText(); if (DatabaseInfo != null) { txtVersion.Text = DatabaseInfo.ServerVersion; } ConfigureOptions(); LoadHighlighter(); SqlTextBox.TextChanged += SqlTextBox_TextChanged; SqlTextBox.Focus(); } catch (Exception ex) { DataConnectionHelper.SendError(ex, DatabaseInfo?.DatabaseType ?? DatabaseType.SQLServer); } }
public ForeignKeyDialog(string tableName) { Telemetry.TrackPageView(nameof(ForeignKeyDialog)); InitializeComponent(); _tableName = tableName; Background = VsThemes.GetWindowBackground(); }
public RenameDialog(string tableName) { Telemetry.TrackPageView(nameof(RenameDialog)); InitializeComponent(); Background = VsThemes.GetWindowBackground(); Title = "Rename " + tableName; ServerName.Text = tableName; }
private void MyToolWindow_Loaded(object sender, RoutedEventArgs e) { if (_loaded) return; TreeView1.Background = grid1.Background = VsThemes.GetToolWindowBackground(); var overflowGrid = explorerToolbar.Template.FindName("OverflowGrid", explorerToolbar) as FrameworkElement; if (overflowGrid != null) { overflowGrid.Visibility = Visibility.Collapsed; } Updated.Visibility = Visibility.Collapsed; // Look for update async var bw = new BackgroundWorker(); bw.DoWork += bw_DoWork; bw.RunWorkerCompleted += (s, ea) => { try { PrepareTreeView("Data Connections"); Refresh.IsEnabled = true; if ((bool)ea.Result) { Updated.Visibility = Visibility.Visible; _myStoryboard.Begin(this); } else { Updated.Visibility = Visibility.Collapsed; } } finally { bw.Dispose(); } }; // Animate updated button var myDoubleAnimation = new DoubleAnimation { From = 0.1, To = 1.0, Duration = new Duration(TimeSpan.FromSeconds(5)), AutoReverse = true, RepeatBehavior = RepeatBehavior.Forever }; _myStoryboard = new Storyboard(); _myStoryboard.Children.Add(myDoubleAnimation); Storyboard.SetTargetName(myDoubleAnimation, UpdatedText.Name); Storyboard.SetTargetProperty(myDoubleAnimation, new PropertyPath(OpacityProperty)); PrepareTreeView("Loading..."); bw.RunWorkerAsync(); AddHandler(Keyboard.KeyDownEvent, (KeyEventHandler)HandleKeyDownEvent); txtConnections.Focus(); _loaded = true; }
public ExportDialog(Dictionary <string, DatabaseInfo> connections) { Telemetry.TrackPageView(nameof(ExportDialog)); InitializeComponent(); Background = VsThemes.GetWindowBackground(); lblCompare.Content = "Choose the target SQL Server database\n(connected via Server Explorer/Data Connections)"; comboBox1.DisplayMemberPath = "Value.Caption"; comboBox1.ItemsSource = connections; }
public PickServerDatabaseDialog(Dictionary <string, DatabaseInfo> serverConnections) { Telemetry.TrackPageView(nameof(PickServerDatabaseDialog)); InitializeComponent(); Background = VsThemes.GetWindowBackground(); lblCompare.Text = "Choose a database connection already connected in Server Explorer/Data Connections"; comboBox1.DisplayMemberPath = "Value.Caption"; comboBox1.ItemsSource = serverConnections; }
public ConnectionDialog() { Telemetry.TrackPageView(nameof(ConnectionDialog)); _loading = true; InitializeComponent(); Background = VsThemes.GetWindowBackground(); SaveButton.IsEnabled = false; TestButton.IsEnabled = false; _loading = false; }
public EfCoreMigrationsDialog(EFCorePowerTools.EFCorePowerToolsPackage package, string outputPath, Project project) { Telemetry.TrackPageView(nameof(EfCoreModelDialog)); InitializeComponent(); Background = VsThemes.GetWindowBackground(); _package = package; _outputPath = outputPath; _project = project; _processLauncher = new ProcessLauncher(project.IsNetCore(), project.IsNetCore21()); }
public DescriptionDialog(string tableDescription) { Telemetry.TrackPageView(nameof(DescriptionDialog)); InitializeComponent(); Background = VsThemes.GetWindowBackground(); if (!string.IsNullOrWhiteSpace(tableDescription)) { txtTableDesc.Text = tableDescription; } }
public EfCoreMigrationsDialog(EFCorePowerTools.EFCorePowerToolsPackage package, string outputPath, bool isNetCore, Project project) { Telemetry.TrackPageView(nameof(EfCoreModelDialog)); InitializeComponent(); Background = VsThemes.GetWindowBackground(); _package = package; _isNetCore = isNetCore; _outputPath = outputPath; _project = project; }
public TableBuilderDialog(string tableDescription, DatabaseType dbType) { Telemetry.TrackPageView(nameof(TableBuilderDialog)); InitializeComponent(); _dbType = dbType; Background = VsThemes.GetWindowBackground(); if (!string.IsNullOrWhiteSpace(tableDescription)) { txtTableDesc.Text = tableDescription; } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); lblQuickFind.ForeColor = lblOn.ForeColor = lblCol.ForeColor = VsThemes.GetWindowTextColor(); lblQuickFind.Location = new Point(btnClose.Right, GetY(lblQuickFind)); txtToFind.Location = new Point(lblQuickFind.Right, GetY(txtToFind)); lblOn.Location = new Point(txtToFind.Right, GetY(lblOn)); lblCol.Location = new Point(lblOn.Right, GetY(lblCol)); }
public PickTablesDialog(bool allowWindow) { Telemetry.TrackPageView(nameof(PickTablesDialog)); InitializeComponent(); Background = VsThemes.GetWindowBackground(); if (!allowWindow) { button1.Content = "OK"; btnWindow.Visibility = Visibility.Collapsed; } ; }
private void PrepareTreeView(string label) { Refresh.IsEnabled = false; txtHelp.Foreground = VsThemes.GetWindowText(); RootItem.Foreground = VsThemes.GetWindowText(); txtConnections.Text = label; txtConnections.Focus(); RootItem.ContextMenu = new DatabasesContextMenu(new DatabaseMenuCommandParameters { ExplorerControl = this }, _parentWindow); RootItem.Foreground = VsThemes.GetWindowText(); }
public PickServerDatabaseDialog(Dictionary <string, DatabaseInfo> serverConnections, EFCorePowerTools.EFCorePowerToolsPackage package) { _package = package; Telemetry.TrackPageView(nameof(PickServerDatabaseDialog)); InitializeComponent(); Background = VsThemes.GetWindowBackground(); comboBox1.DisplayMemberPath = "Value.Caption"; comboBox1.ItemsSource = serverConnections; if (serverConnections.Count > 0) { comboBox1.SelectedIndex = 0; } }
public CompareDialog(string caption, Dictionary <string, DatabaseInfo> connections, string tableName = null) { Telemetry.TrackPageView(nameof(CompareDialog)); InitializeComponent(); Background = VsThemes.GetWindowBackground(); lblCompare.Text = string.Format("Choose the target database to compare {0} (source) with:", caption); if (!string.IsNullOrEmpty(tableName)) { lblCompare.Text = string.Format("Choose the database to compare table {0} in {1} (source) with:", tableName, caption); Title = "Script Table Data Diff"; } comboBox1.DisplayMemberPath = "Value.Caption"; comboBox1.ItemsSource = connections; }
private void PrepareTreeView(string label) { Refresh.IsEnabled = false; txtHelp.Foreground = VsThemes.GetWindowText(); RootItem.Foreground = VsThemes.GetWindowText(); txtConnections.Text = label; txtConnections.Focus(); RootItem.ContextMenu = new DatabasesContextMenu(new DatabaseMenuCommandParameters { ExplorerControl = this }, _parentWindow); RootItem.Foreground = VsThemes.GetWindowText(); if (!DataConnectionHelper.IsV35Installed() && !DataConnectionHelper.IsV40Installed()) { RuntimeMissing.Visibility = Visibility.Visible; } }
private void SqlEditorWindow_Loaded(object sender, RoutedEventArgs e) { try { var overflowGrid = toolBar1.Template.FindName("OverflowGrid", toolBar1) as FrameworkElement; if (overflowGrid != null) { overflowGrid.Visibility = Visibility.Collapsed; } var package = _parentWindow.Package as SqlCeToolboxPackage; if (package == null) { return; } Dte = package.GetServiceHelper(typeof(DTE)) as DTE; toolBar1.Background = toolTray.Background = VsThemes.GetCommandBackground(); dock1.Background = VsThemes.GetWindowBackground(); sep4.Background = VsThemes.GetToolbarSeparatorBackground(); txtSaveAs.Foreground = VsThemes.GetWindowText(); if (DatabaseInfo != null) { txtVersion.Text = DatabaseInfo.ServerVersion; } LoadDefaultOptions(); ConfigureOptions(); LoadHighlighter(); //TODO //formsHost.Visibility = Visibility.Collapsed; SqlTextBox.TextChanged += SqlTextBox_TextChanged; //TODO Entry point for Intellisense //SqlTextBox.TextArea.TextEntering += SqlTextBox_TextArea_TextEntering; //SqlTextBox.TextArea.TextEntered += SqlTextBox_TextArea_TextEntered; SqlTextBox.Focus(); } catch (Exception ex) { DataConnectionHelper.SendError(ex, DatabaseInfo != null ? DatabaseInfo.DatabaseType : DatabaseType.SQLServer); } }
public EfCoreModelDialog(ReverseEngineerOptions options) { _options = options; Telemetry.TrackPageView(nameof(EfCoreModelDialog)); InitializeComponent(); Background = VsThemes.GetWindowBackground(); if (_options != null) { chkDataAnnoations.IsChecked = !options.UseFluentApiOnly; chkUseDatabaseNames.IsChecked = options.UseDatabaseNames; chkPluralize.IsChecked = options.UseInflector; chkHandlebars.IsChecked = options.UseHandleBars; chkIdReplace.IsChecked = options.IdReplace; chkIncludeConnectionString.IsChecked = options.IncludeConnectionString; ModelName = options.ContextClassName; NameSpace = options.ProjectRootNamespace; OutputPath = options.OutputPath; cmbLanguage.SelectedIndex = options.SelectedToBeGenerated; SetCheckState(); } }
public PickTablesDialog() { Telemetry.TrackPageView(nameof(PickTablesDialog)); InitializeComponent(); Background = VsThemes.GetWindowBackground(); }
public DataContextDialog() { Telemetry.TrackPageView(nameof(DataContextDialog)); InitializeComponent(); Background = VsThemes.GetWindowBackground(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { Background = VsThemes.GetWindowBackground(); Version.Text = "Version " + Assembly.GetExecutingAssembly().GetName().Version; txtStatus.Text = "SQL Server Compact 4.0 in GAC - "; try { var version = new SqlCeHelper4().IsV40Installed(); if (version != null) { txtStatus.Text += string.Format("Yes - {0}\n", version); } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "SQL Server Compact 4.0 DbProvider - "; try { System.Data.Common.DbProviderFactories.GetFactory(EFCorePowerTools.Resources.SqlCompact40InvariantName); txtStatus.Text += "Yes\n"; } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "\nSQL Server Compact 4.0 DDEX provider - "; try { if (EnvDteHelper.DdexProviderIsInstalled(new Guid(EFCorePowerTools.Resources.SqlCompact40Provider))) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "SQL Server Compact 4.0 Simple DDEX provider - "; try { if (EnvDteHelper.DdexProviderIsInstalled(new Guid(EFCorePowerTools.Resources.SqlCompact40PrivateProvider))) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "\n\nSQLite ADO.NET Provider included: "; try { Assembly asm = Assembly.Load("System.Data.SQLite"); txtStatus.Text += string.Format("{0}\n", asm.GetName().Version); } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "SQLite EF6 DbProvider in GAC - "; try { if (EnvDteHelper.IsSqLiteDbProviderInstalled()) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "\nSystem.Data.SQLite DDEX provider - "; try { if (EnvDteHelper.DdexProviderIsInstalled(new Guid(EFCorePowerTools.Resources.SQLiteProvider))) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "SQLite Simple DDEX provider - "; try { if (EnvDteHelper.DdexProviderIsInstalled(new Guid(EFCorePowerTools.Resources.SqlitePrivateProvider))) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } }
private void Window_Loaded(object sender, RoutedEventArgs e) { if (SqlCeToolboxPackage.VisualStudioVersion < new Version(11, 0)) { DDEXButton.Visibility = Visibility.Collapsed; } BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += bw_DoWork; bw.RunWorkerCompleted += (s, ea) => { Version.Text = "Version " + Assembly.GetExecutingAssembly().GetName().Version + " " + ea.Result.ToString(); }; bw.RunWorkerAsync(); Background = VsThemes.GetWindowBackground(); Version.Text = "Version " + Assembly.GetExecutingAssembly().GetName().Version; txtStatus.Text = "SQL Server Compact 4.0 in GAC - "; try { Assembly asm4 = Assembly.Load("System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"); FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(asm4.Location); string version = fvi.FileVersion; txtStatus.Text += string.Format("Yes - {0}\n", version); } catch (FileNotFoundException) { txtStatus.Text += "No\n"; } txtStatus.Text += "SQL Server Compact 4.0 DbProvider - "; try { System.Data.Common.DbProviderFactories.GetFactory(SqlCeToolbox.Resources.SqlCompact40InvariantName); txtStatus.Text += "Yes\n"; } catch (System.Configuration.ConfigurationException) { txtStatus.Text += "No\n"; } catch (ArgumentException) { txtStatus.Text += "No\n"; } txtStatus.Text += "\nSQL Server Compact 4.0 DDEX provider - "; try { if (DataConnectionHelper.DdexProviderIsInstalled(new Guid(SqlCeToolbox.Resources.SqlCompact40Provider))) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "SQL Server Compact 4.0 Simple DDEX provider - "; try { if (DataConnectionHelper.DdexProviderIsInstalled(new Guid(SqlCeToolbox.Resources.SqlCompact40PrivateProvider))) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } var tempFile40 = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); var tempFile35 = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); try { var helper = DataConnectionHelper.CreateEngineHelper(DatabaseType.SQLCE40); var conn40 = string.Format("Data Source={0}", tempFile40); helper.CreateDatabase(conn40); txtStatus.Text += "SQL Server Compact 4.0 Engine test: PASS!\n"; } catch { txtStatus.Text += "SQL Server Compact 4.0 Engine test: FAIL!\n"; } txtStatus.Text += "\n\nSQL Server Compact 3.5 in GAC - "; var sqlce35Ver = new Version(0, 0, 0); try { var asm35 = Assembly.Load("System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"); var fvi = FileVersionInfo.GetVersionInfo(asm35.Location); sqlce35Ver = new Version(fvi.FileVersion); txtStatus.Text += string.Format("Yes - {0}\n", sqlce35Ver); } catch (FileNotFoundException) { txtStatus.Text += "No\n"; } if (sqlce35Ver > new Version(0, 0, 0) && sqlce35Ver < new Version(3, 5, 8080)) { txtStatus.Text += "(Too old version installed, update to 3.5 SP2)\n"; } txtStatus.Text += "SQL Server Compact 3.5 DbProvider - "; try { System.Data.Common.DbProviderFactories.GetFactory(SqlCeToolbox.Resources.SqlCompact35InvariantName); txtStatus.Text += "Yes\n"; } catch (System.Configuration.ConfigurationException) { txtStatus.Text += "No\n"; } catch (ArgumentException) { txtStatus.Text += "No\n"; } txtStatus.Text += "\nSQL Server Compact 3.5 DDEX provider - "; try { if (DataConnectionHelper.DdexProviderIsInstalled(new Guid(SqlCeToolbox.Resources.SqlCompact35Provider))) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "SQL Server Compact 3.5 Simple DDEX provider - "; try { if (DataConnectionHelper.DdexProviderIsInstalled(new Guid(SqlCeToolbox.Resources.SqlCompact35PrivateProvider))) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } try { var helper = DataConnectionHelper.CreateEngineHelper(DatabaseType.SQLCE35); var conn35 = string.Format("Data Source={0}", tempFile35); helper.CreateDatabase(conn35); txtStatus.Text += "SQL Server Compact 3.5 Engine test: PASS!\n"; } catch { txtStatus.Text += "SQL Server Compact 3.5Engine test: FAIL!\n"; } txtStatus.Text += "\n\nSync Framework 2.1 SqlCe 3.5 provider - "; if (DataConnectionHelper.IsSyncFx21Installed()) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } txtStatus.Text += "\n\nSQLite ADO.NET Provider included: "; try { Assembly asm = Assembly.Load("System.Data.SQLite"); txtStatus.Text += string.Format("{0}\n", asm.GetName().Version); } catch (FileNotFoundException) { txtStatus.Text += "No\n"; } txtStatus.Text += "SQLite EF6 DbProvider in GAC - "; try { if (DataConnectionHelper.IsSqLiteDbProviderInstalled()) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } try { if (File.Exists(tempFile40)) { File.Delete(tempFile40); } if (File.Exists(tempFile35)) { File.Delete(tempFile35); } } catch { // ignored } }
public EfCoreModelDialog() { Telemetry.TrackPageView(nameof(EfCoreModelDialog)); InitializeComponent(); Background = VsThemes.GetWindowBackground(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { var bw = new BackgroundWorker(); bw.DoWork += bw_DoWork; bw.RunWorkerCompleted += (s, ea) => { Version.Text = "Version " + Assembly.GetExecutingAssembly().GetName().Version + " " + ea.Result.ToString(); }; bw.RunWorkerAsync(); Background = VsThemes.GetWindowBackground(); Version.Text = "Version " + Assembly.GetExecutingAssembly().GetName().Version; txtStatus.Text = "SQL Server Compact 4.0 in GAC - "; try { var version = new SqlCeHelper4().IsV40Installed(); if (version != null) { txtStatus.Text += string.Format("Yes - {0}\n", version); } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "SQL Server Compact 4.0 DbProvider - "; try { System.Data.Common.DbProviderFactories.GetFactory(SqlCeToolbox.Resources.SqlCompact40InvariantName); txtStatus.Text += "Yes\n"; } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "SQL Server Compact 4.0 Simple DDEX provider - "; try { if (DataConnectionHelper.DdexProviderIsInstalled(new Guid(SqlCeToolbox.Resources.SqlCompact40PrivateProvider))) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "\n\nSQL Server Compact 3.5 in GAC - "; try { var version = new SqlCeHelper().IsV35Installed(); if (version != null) { txtStatus.Text += string.Format("Yes - {0}\n", version); } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "SQL Server Compact 3.5 DbProvider - "; try { System.Data.Common.DbProviderFactories.GetFactory(SqlCeToolbox.Resources.SqlCompact35InvariantName); txtStatus.Text += "Yes\n"; } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "\n\nSync Framework 2.1 SqlCe 3.5 provider - "; if (DataConnectionHelper.IsSyncFx21Installed()) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } txtStatus.Text += $"\n\nSQLite ADO.NET Provider used: {Helpers.RepositoryHelper.SqliteEngineVersion}\n"; txtStatus.Text += "SQLite EF6 DbProvider in GAC - "; try { if (DataConnectionHelper.IsSqLiteDbProviderInstalled()) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "System.Data.SQLite DDEX provider - "; try { if (DataConnectionHelper.DdexProviderIsInstalled(new Guid(SqlCeToolbox.Resources.SQLiteProvider))) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } txtStatus.Text += "SQLite Simple DDEX provider - "; try { if (DataConnectionHelper.DdexProviderIsInstalled(new Guid(SqlCeToolbox.Resources.SqlitePrivateProvider))) { txtStatus.Text += "Yes\n"; } else { txtStatus.Text += "No\n"; } } catch { txtStatus.Text += "No\n"; } }