コード例 #1
0
 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);
     }
 }
コード例 #2
0
 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();
 }
コード例 #3
0
 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;
     }
 }
コード例 #4
0
        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);
            }
        }