SqlScriptEditorControl Class

Definition

Implements SQL script editing. This class implements all execution options of scripts and handles all requests from the menu toolbars.

public ref class SqlScriptEditorControl : Microsoft::SqlServer::Management::UI::VSIntegration::Editors::ScriptAndResultsEditorControl, Microsoft::VisualStudio::Shell::Interop::IVsRunningDocTableEvents
public class SqlScriptEditorControl : Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptAndResultsEditorControl, Microsoft.VisualStudio.Shell.Interop.IVsRunningDocTableEvents
type SqlScriptEditorControl = class
    inherit ScriptAndResultsEditorControl
    interface IVsRunningDocTableEvents
Public Class SqlScriptEditorControl
Inherits ScriptAndResultsEditorControl
Implements IVsRunningDocTableEvents
Inheritance
Implements

Remarks

The execution and results presentation of scripts is done by the DisplaySQLResultsControl class.

Fields

buildAction (Inherited from ScriptEditorControl)
disconnectAfterQuery

If True, disconnects after query executes.

executionControlHost

Container for everything but the status bar. Used for layout.

fedRootName

Specifies the name of the root federation.

(Inherited from ScriptAndResultsEditorControl)
initialFocus (Inherited from ScriptEditorControl)
isCloudDatabase

Determines whether SQL Server Management Studio is currently connected to a SQL Azure server.

(Inherited from ScriptAndResultsEditorControl)
isClrProjectFile (Inherited from ScriptEditorControl)
isDacProjectFile (Inherited from ScriptEditorControl)
isFedMemAttrChecked

A Boolean value that indicates whether the federation member attribute is checked.

(Inherited from ScriptAndResultsEditorControl)
m_connection

Cached connection that is associated with the window.

(Inherited from ScriptAndResultsEditorControl)
m_connectionInfoList

Cached connection info that is used in communication with the connection dialog box.

(Inherited from ScriptAndResultsEditorControl)
m_connectionToUse

Specifies a connection information that should be applied to the window after it is fully initialized, unless it is stamped with another connection.

(Inherited from ScriptAndResultsEditorControl)
m_dtExecBegan

Specifies a member to store at the beginning of script execution.

(Inherited from ScriptAndResultsEditorControl)
m_Editor (Inherited from ScriptEditorControl)
m_scriptSplitter

Splitter to horizontally separate script and other elements.

(Inherited from ScriptAndResultsEditorControl)
m_serviceProvider (Inherited from ScriptEditorControl)
m_sp (Inherited from ShellWindowPaneUserControl)
m_strOrigMoniker (Inherited from ScriptEditorControl)
m_timeElapsedTimer

Timer for updating properties window with elapsed time during query execution.

(Inherited from ScriptAndResultsEditorControl)
menuCommands (Inherited from ShellWindowPaneUserControl)
projectNode (Inherited from ScriptEditorControl)
selectionServiceForProperties (Inherited from ShellWindowPaneUserControl)
shardName

Specifies the shard name.

(Inherited from ScriptAndResultsEditorControl)
statusBar

Status bar.

(Inherited from ScriptAndResultsEditorControl)
statusBarManager (Inherited from ScriptEditorControl)
sysShardName

Specifies the system shard name.

(Inherited from ScriptAndResultsEditorControl)

Properties

BuildAction (Inherited from ScriptEditorControl)
CmdUIGuid

Returns GUID that is associated with toolbars and menu items that should automatically be visible when this document window is active.

Connection

Returns parameters in the case where script editor has a current connection.

(Inherited from ScriptAndResultsEditorControl)
ConnectionInfoList

Gets connection context for the editor.

(Inherited from ScriptAndResultsEditorControl)
CurrentDB

Gets or sets the database that is current for this script.

DefaultHelpContext

Gets the keyword that is pushed into the dynamic help window by default when this editor is active.

DocData (Inherited from ScriptEditorControl)
EditorText (Inherited from ScriptEditorControl)
InitialFocus (Inherited from ScriptEditorControl)
IsAFedMember

Gets or sets a value that indicates whether the current database is a federation member.

(Inherited from ScriptAndResultsEditorControl)
IsConnected

Gets or sets whether the editor control is connected.

(Inherited from ScriptAndResultsEditorControl)
IsControlUnderSplitterVisible

Gets a Boolean value that specifies how the window will be resized.

(Inherited from ScriptAndResultsEditorControl)
IsDebugging

Gets or sets whether the script is being executed.

(Inherited from ScriptAndResultsEditorControl)
IsExecuting

Gets or sets whether the script is being executed.

(Inherited from ScriptAndResultsEditorControl)
IsFrameActive (Inherited from ScriptEditorControl)
IsScriptEditorActive

Gets a Boolean value that specifies whether the code editor is currently active.

(Inherited from ScriptAndResultsEditorControl)
IsSqlCmdMode

Gets or sets the flag that specifies whether SQLCMD mode is set.

(Inherited from ScriptAndResultsEditorControl)
IsSqlObjectDocument

Gets a Boolean which determines if the SqlScriptEditorControl is a debugging window.

IsWithNumberOfRowsOnStatusBar

Gets a Boolean value that specifies whether the status bar contains a panel for number of fetched rows.

(Inherited from ScriptAndResultsEditorControl)
LanguageServiceGUID

Gets the GUID of the language service that should be specified for the Visual Studio editor with the text of the script.

MyOptions

Gets or sets connection options that will be used by this window for execution.

NameInPropWindow (Inherited from ShellWindowPaneUserControl)
ScriptEditorContextMenuID

Gets the identifier of the context menu that should be shown when user right clicks on script editor.

ShowCurrentResultsBelowSplitter

Gets a Boolean value that indicates whether current query results are shown below the splitter on the tabs on the same level with the query text.

SqlCmdVars

Gets or sets a dictionary containing all the variables and their values from sqlcmdvars file in Database projects in Visual Studio.

(Inherited from ScriptAndResultsEditorControl)
StatusBarManager (Inherited from ScriptEditorControl)
VsUserContext (Inherited from ScriptEditorControl)

Methods

CanDebug()

Enables SQLWorkbenchCommands.cmdidDebugQuery and VSStandardCommands97.cmdidStart.

ChangeConnection()

Called when user wants to reconnect to another server while connected.

(Inherited from ScriptAndResultsEditorControl)
ChangeEditorConnection(String, String)

Sets the new editor connection from parameters.

ClearCachedValues()

Clears cache values from previous shard operations.

(Inherited from ScriptAndResultsEditorControl)
ClosePane() (Inherited from ShellWindowPaneUserControl)
Connect()

Connects to the server.

CreateInstance(Object, Boolean, Boolean)

Creates an instance of the SqlScriptEditorControl class.

CreateInstance(Object, Boolean, String)

Creates a new instance of the SqlScriptEditorControl class.

CreatePaneWindow(IntPtr, Int32, Int32, Int32, Int32, IntPtr) (Inherited from ShellWindowPaneUserControl)
Disconnect()

Disconnects the control.

Dispose(Boolean)

Cleans up any resources used.

Exec(Guid, UInt32, UInt32, IntPtr, IntPtr) (Inherited from ShellWindowPaneUserControl)
FillMenuCommands()

Called by the base class to add handlers for menu items.

GetDefaultSize(SIZE[]) (Inherited from ShellWindowPaneUserControl)
GetFrameCaption(String) (Inherited from ScriptEditorControl)
GetPropertiesWindowWithConnection()

Needed by SQL Server Compact 3.5 to avoid code duplication;

GetService(Guid) (Inherited from ShellWindowPaneUserControl)
GetService(Type) (Inherited from ShellWindowPaneUserControl)
HandleCurrentWindowOptionsCommand()

Called when user selects "Current Window Options" menu command.

InitializeSplitter()

Does all splitter-related initialization.

(Inherited from ScriptAndResultsEditorControl)
InitializeStatusBar()

Performs status-bar related initialization. Derived classes should override it to add more status bar panels and adjust it.

(Inherited from ScriptAndResultsEditorControl)
IsSqlClrProjectFile(IVsTextView) (Inherited from ScriptEditorControl)
LoadViewState(IStream) (Inherited from ScriptEditorControl)
OnDockableChange(Int32) (Inherited from ShellWindowPaneUserControl)
OnExec(Guid, UInt32, UInt32, IntPtr, IntPtr)

Overrides the OnExec function.

OnHosted()

Called when control is sited by Visual Studio. At this time, service providers have already been stored in internal variables, so it is safe to call GetService.

OnMove() (Inherited from ShellWindowPaneUserControl)
OnQueryStatus(Guid, UInt32, OLECMD[], IntPtr)

Overrides the OnQueryStatus function.

OnResize(EventArgs)

Overrides the WinForms Control base class.

(Inherited from ScriptAndResultsEditorControl)
OnShow(Int32) (Inherited from ScriptEditorControl)
OnShowEstimatedPlan(Object, EventArgs)

Called every time user selects "Show estimated plan" menu item.

OnShowTemplateParamsGrid(Object, EventArgs)

Displays template parameters. The Substitution grid is a modal dialog box.

OnSize() (Inherited from ShellWindowPaneUserControl)
OnWindowPaneClose() (Inherited from ShellWindowPaneUserControl)
OnWindowPaneCreate() (Inherited from ShellWindowPaneUserControl)
ProcessQEOptionsChange(QEOptionsComponent, QueryExecutionSettings)

Called when user modifies global QE Options using the Tools menu, Options submenu.

QueryStatus(Guid, UInt32, OLECMD[], IntPtr) (Inherited from ShellWindowPaneUserControl)
SaveViewState(IStream) (Inherited from ScriptEditorControl)
SetConnection(UIConnectionGroupInfo)

Associates a connection context with the script editor.

(Inherited from ScriptAndResultsEditorControl)
SetConnection(UIConnectionGroupInfo, IDbConnection)

Enables stamp with live connection.

(Inherited from ScriptAndResultsEditorControl)
SetConnection(UIConnectionInfo)

Associate a connection with the script.

(Inherited from ScriptAndResultsEditorControl)
SetConnection(UIConnectionInfo, IDbConnection)

Enables stamp used with live connection

(Inherited from ScriptAndResultsEditorControl)
SetSite(IServiceProvider) (Inherited from ScriptEditorControl)
ShouldSubscribeToChildrenFocusEvent(Control) (Inherited from ScriptEditorControl)
ShouldTryToReconnectWithCachedCI(UIConnectionInfo)

Indicates whether to reconnect automatically with the given connection information or display prepopulated connection dialog box.

ShowMessage(String, String, MessageBoxButtons, MessageBoxIcon) (Inherited from ScriptEditorControl)
ToggleResultsControl(Boolean)

Shows or hides the query results control.

(Inherited from ScriptAndResultsEditorControl)
TranslateAccelerator(MSG[])

Called by Visual Studio to give the window pane a chance to interpret messages before they are routed to their associated windows. Override that enables order processing of WM_MOUSEWHEEL by the grid.

UpdateMenuCommandsStatus(MenuCommand)

Called by the base class to update commands status.

UpdatePropWindow(Object) (Inherited from ShellWindowPaneUserControl)
UpdatePropWindowWithConnection()

Shortcut to update property window with settings when connection completes.

Events

NewConnectionForScript

Event that is fired when a user specifies a new connection for the script from the connection dialog box.

(Inherited from ScriptAndResultsEditorControl)

Explicit Interface Implementations

ICustomTypeDescriptor.GetAttributes() (Inherited from ShellWindowPaneUserControl)
ICustomTypeDescriptor.GetClassName() (Inherited from ShellWindowPaneUserControl)
ICustomTypeDescriptor.GetComponentName() (Inherited from ShellWindowPaneUserControl)
ICustomTypeDescriptor.GetConverter() (Inherited from ShellWindowPaneUserControl)
ICustomTypeDescriptor.GetDefaultEvent() (Inherited from ShellWindowPaneUserControl)
ICustomTypeDescriptor.GetDefaultProperty() (Inherited from ShellWindowPaneUserControl)
ICustomTypeDescriptor.GetEditor(Type) (Inherited from ShellWindowPaneUserControl)
ICustomTypeDescriptor.GetEvents() (Inherited from ShellWindowPaneUserControl)
ICustomTypeDescriptor.GetEvents(Attribute[]) (Inherited from ShellWindowPaneUserControl)
ICustomTypeDescriptor.GetProperties() (Inherited from ShellWindowPaneUserControl)
ICustomTypeDescriptor.GetProperties(Attribute[]) (Inherited from ShellWindowPaneUserControl)
ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor) (Inherited from ShellWindowPaneUserControl)
IVsCodeWindow.Close() (Inherited from ScriptEditorControl)
IVsCodeWindow.GetBuffer(IVsTextLines) (Inherited from ScriptEditorControl)
IVsCodeWindow.GetEditorCaption(READONLYSTATUS, String) (Inherited from ScriptEditorControl)
IVsCodeWindow.GetLastActiveView(IVsTextView) (Inherited from ScriptEditorControl)
IVsCodeWindow.GetPrimaryView(IVsTextView) (Inherited from ScriptEditorControl)
IVsCodeWindow.GetSecondaryView(IVsTextView) (Inherited from ScriptEditorControl)
IVsCodeWindow.GetViewClassID(Guid) (Inherited from ScriptEditorControl)
IVsCodeWindow.SetBaseEditorCaption(String[]) (Inherited from ScriptEditorControl)
IVsCodeWindow.SetBuffer(IVsTextLines) (Inherited from ScriptEditorControl)
IVsCodeWindow.SetViewClassID(Guid) (Inherited from ScriptEditorControl)
IVsFindTarget.Find(String, UInt32, Int32, IVsFindHelper, UInt32) (Inherited from ScriptEditorControl)
IVsFindTarget.GetCapabilities(Boolean[], UInt32[]) (Inherited from ScriptEditorControl)
IVsFindTarget.GetCurrentSpan(TextSpan[]) (Inherited from ScriptEditorControl)
IVsFindTarget.GetFindState(Object) (Inherited from ScriptEditorControl)
IVsFindTarget.GetMatchRect(RECT[]) (Inherited from ScriptEditorControl)
IVsFindTarget.GetProperty(UInt32, Object) (Inherited from ScriptEditorControl)
IVsFindTarget.GetSearchImage(UInt32, IVsTextSpanSet[], IVsTextImage) (Inherited from ScriptEditorControl)
IVsFindTarget.MarkSpan(TextSpan[]) (Inherited from ScriptEditorControl)
IVsFindTarget.NavigateTo(TextSpan[]) (Inherited from ScriptEditorControl)
IVsFindTarget.NotifyFindTarget(UInt32) (Inherited from ScriptEditorControl)
IVsFindTarget.Replace(String, String, UInt32, Int32, IVsFindHelper, Int32) (Inherited from ScriptEditorControl)
IVsFindTarget.SetFindState(Object) (Inherited from ScriptEditorControl)
IVsRunningDocTableEvents.OnAfterAttributeChange(UInt32, UInt32)
IVsRunningDocTableEvents.OnAfterDocumentWindowHide(UInt32, IVsWindowFrame)
IVsRunningDocTableEvents.OnAfterFirstDocumentLock(UInt32, UInt32, UInt32, UInt32)
IVsRunningDocTableEvents.OnAfterSave(UInt32)
IVsRunningDocTableEvents.OnBeforeDocumentWindowShow(UInt32, Int32, IVsWindowFrame)
IVsRunningDocTableEvents.OnBeforeLastDocumentUnlock(UInt32, UInt32, UInt32, UInt32)
IVsStatusbarUser.SetInfo() (Inherited from ScriptEditorControl)
IVsWindowFrameNotify3.OnClose(UInt32) (Inherited from ScriptAndResultsEditorControl)
IVsWindowFrameNotify3.OnDockableChange(Int32, Int32, Int32, Int32, Int32) (Inherited from ScriptAndResultsEditorControl)
IVsWindowFrameNotify3.OnMove(Int32, Int32, Int32, Int32) (Inherited from ScriptAndResultsEditorControl)
IVsWindowFrameNotify3.OnSize(Int32, Int32, Int32, Int32) (Inherited from ScriptAndResultsEditorControl)

Applies to