SSQLE  1.0
Simple SQL Editor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SSQLE.Editor Class Reference

Class representing an SQL Editor with input, output and other features. More...

Inheritance diagram for SSQLE.Editor:

Public Member Functions

 Editor (IConnection connection)
 Constructs new editor with given IConnection. More...
 
void SaveQuery (string name)
 Saves the query currently in query editor by given name to Settings. More...
 

Protected Member Functions

override void Dispose (bool disposing)
 Clean up any resources being used. More...
 

Private Member Functions

void ConfigureScintillaTextSettings ()
 Configures Scintilla.NET settings, which can't be configured in designer. More...
 
void ConfigureScintillaKeywords ()
 Configures Scintilla.NET settings, which can't be configured in designer. More...
 
void btn_execute_Click (object sender, EventArgs e)
 Handler, that is executed whenever user clicks on Execute button, or presses key command to execute query. More...
 
void SetStatusBarText (string newText="")
 Changes text of status bar. More...
 
void asCsvToolStripMenuItem_Click (object sender, EventArgs e)
 Handler, that is executed whenever user clicks on Save query as CSV. More...
 
void asInsertStatementToolStripMenuItem_Click (object sender, EventArgs e)
 Handler, that is executed whenever user clicks on Save query as SQL INSERT statement. More...
 
void exitToolStripMenuItem_Click (object sender, EventArgs e)
 Handler, that is executed whenever user clicks on File close menu item. It closes the Editor form. More...
 
void btn_next_cmd_Click (object sender, EventArgs e)
 Handler, that is executed whenever user clicks on next command from history button, or presses key command to execute query. More...
 
void btn_previous_cmd_Click (object sender, EventArgs e)
 Handler, that is executed whenever user clicks on previous command from history button, or presses key command to execute query. More...
 
void SetCommandFromHistory (string command)
 Changes the text of Query editor to given argument. More...
 
void Editor_FormClosing (object sender, FormClosingEventArgs e)
 Handler, that is called when Editor is closing. Handles SettingsSaveException. More...
 
void queryToolStripMenuItem_Click (object sender, EventArgs e)
 Handler, that is executed whenever user clicks on Save query menu item. More...
 
void AddLoadQueryDropDown (string name)
 Adds menu item to Load menu for loading a saved query. More...
 
void btn_load_query_Click (object sender, EventArgs e)
 Handler, that is executed whenever user clicks on load query menu item. More...
 
void Editor_KeyDown (object sender, KeyEventArgs e)
 Handler, that is executed whenever user presses key. More...
 
void InitializeComponent ()
 Required method for Designer support - do not modify the contents of this method with the code editor. More...
 

Static Private Member Functions

static string SaveFileDialog (string filter, Action< TextWriter > dataProvider)
 Performs save of query results to format driven by dataProvider to a file using SaveFileDialog. More...
 

Private Attributes

readonly IConnection connection
 Connection that the editor uses for executing queries. More...
 
QueryResult currentQueryResult
 Result of last executed query. More...
 
int historyIndex
 Index to history commands. See CommandsHistory. More...
 
System.ComponentModel.IContainer components = null
 Required designer variable. More...
 
System.Windows.Forms.SplitContainer splitContainer
 
System.Windows.Forms.Panel panelTop
 
System.Windows.Forms.Panel panelBottom
 
System.Windows.Forms.ToolStripStatusLabel statusBarLabel
 
System.Windows.Forms.MenuStrip menuBar
 
System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem
 
ScintillaNET.Scintilla scintillaInput
 
System.Windows.Forms.Button btn_execute
 
System.Windows.Forms.StatusStrip statusBar
 
System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem
 
System.Windows.Forms.ToolStripMenuItem resultToolStripMenuItem
 
System.Windows.Forms.ToolStripMenuItem asCSVToolStripMenuItem
 
System.Windows.Forms.ToolStripMenuItem asInsertStatementToolStripMenuItem
 
System.Windows.Forms.ToolStripMenuItem queryToolStripMenuItem
 
System.Windows.Forms.ToolStripMenuItem loadQueryToolStripMenuItem
 
System.Windows.Forms.ToolTip tooltip_execute
 
System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem
 
System.Windows.Forms.Button btn_next_cmd
 
System.Windows.Forms.Button btn_previous_cmd
 
ScintillaNET.Scintilla scintillaResults
 

Detailed Description

Class representing an SQL Editor with input, output and other features.

Constructor & Destructor Documentation

SSQLE.Editor.Editor ( IConnection  connection)

Constructs new editor with given IConnection.

Parameters
connectionConnection, which Editor uses for executing queries.

Member Function Documentation

void SSQLE.Editor.AddLoadQueryDropDown ( string  name)
private

Adds menu item to Load menu for loading a saved query.

Parameters
nameName of the query.
void SSQLE.Editor.asCsvToolStripMenuItem_Click ( object  sender,
EventArgs  e 
)
private

Handler, that is executed whenever user clicks on Save query as CSV.

Parameters
senderToolStripMenuItem, that was clicked on.
eEvent arguments.
void SSQLE.Editor.asInsertStatementToolStripMenuItem_Click ( object  sender,
EventArgs  e 
)
private

Handler, that is executed whenever user clicks on Save query as SQL INSERT statement.

Parameters
senderToolStripMenuItem, that was clicked on.
eEvent arguments.
void SSQLE.Editor.btn_execute_Click ( object  sender,
EventArgs  e 
)
private

Handler, that is executed whenever user clicks on Execute button, or presses key command to execute query.

Parameters
senderButton, that was clicked on, or null if it was executed by key stroke.
eEvent arguments.
void SSQLE.Editor.btn_load_query_Click ( object  sender,
EventArgs  e 
)
private

Handler, that is executed whenever user clicks on load query menu item.

Parameters
senderToolStripMenuItem, that was clicked on.
eEvent arguments.
void SSQLE.Editor.btn_next_cmd_Click ( object  sender,
EventArgs  e 
)
private

Handler, that is executed whenever user clicks on next command from history button, or presses key command to execute query.

Parameters
senderButton, that was clicked on, or null if it was executed by key stroke.
eEvent arguments.
void SSQLE.Editor.btn_previous_cmd_Click ( object  sender,
EventArgs  e 
)
private

Handler, that is executed whenever user clicks on previous command from history button, or presses key command to execute query.

Parameters
senderButton, that was clicked on, or null if it was executed by key stroke.
eEvent arguments.
void SSQLE.Editor.ConfigureScintillaKeywords ( )
private

Configures Scintilla.NET settings, which can't be configured in designer.

void SSQLE.Editor.ConfigureScintillaTextSettings ( )
private

Configures Scintilla.NET settings, which can't be configured in designer.

override void SSQLE.Editor.Dispose ( bool  disposing)
protected

Clean up any resources being used.

Parameters
disposingtrue if managed resources should be disposed; otherwise, false.
void SSQLE.Editor.Editor_FormClosing ( object  sender,
FormClosingEventArgs  e 
)
private

Handler, that is called when Editor is closing. Handles SettingsSaveException.

Parameters
senderEditor
eForm closing event arguments.
void SSQLE.Editor.Editor_KeyDown ( object  sender,
KeyEventArgs  e 
)
private

Handler, that is executed whenever user presses key.

Parameters
senderEditor.
eKey event arguments.
void SSQLE.Editor.exitToolStripMenuItem_Click ( object  sender,
EventArgs  e 
)
private

Handler, that is executed whenever user clicks on File close menu item. It closes the Editor form.

Parameters
senderToolStripMenuItem, that was clicked on.
eEvent arguments.
void SSQLE.Editor.InitializeComponent ( )
private

Required method for Designer support - do not modify the contents of this method with the code editor.

void SSQLE.Editor.queryToolStripMenuItem_Click ( object  sender,
EventArgs  e 
)
private

Handler, that is executed whenever user clicks on Save query menu item.

Parameters
senderToolStripMenuItem, that was clicked on.
eEvent arguments.
static string SSQLE.Editor.SaveFileDialog ( string  filter,
Action< TextWriter >  dataProvider 
)
staticprivate

Performs save of query results to format driven by dataProvider to a file using SaveFileDialog.

Parameters
filterFilter for files in the dialog.
dataProviderFunction, that provides the conversion of Query Result.
Returns
Name of the file
void SSQLE.Editor.SaveQuery ( string  name)

Saves the query currently in query editor by given name to Settings.

Parameters
nameIdentifier of the query for further reuse.
void SSQLE.Editor.SetCommandFromHistory ( string  command)
private

Changes the text of Query editor to given argument.

Parameters
commandCommand to set the query editor to.
void SSQLE.Editor.SetStatusBarText ( string  newText = "")
private

Changes text of status bar.

Parameters
newTextNew text of the status bar.

Member Data Documentation

System.Windows.Forms.ToolStripMenuItem SSQLE.Editor.asCSVToolStripMenuItem
private
System.Windows.Forms.ToolStripMenuItem SSQLE.Editor.asInsertStatementToolStripMenuItem
private
System.Windows.Forms.Button SSQLE.Editor.btn_execute
private
System.Windows.Forms.Button SSQLE.Editor.btn_next_cmd
private
System.Windows.Forms.Button SSQLE.Editor.btn_previous_cmd
private
System.ComponentModel.IContainer SSQLE.Editor.components = null
private

Required designer variable.

readonly IConnection SSQLE.Editor.connection
private

Connection that the editor uses for executing queries.

QueryResult SSQLE.Editor.currentQueryResult
private

Result of last executed query.

System.Windows.Forms.ToolStripMenuItem SSQLE.Editor.exitToolStripMenuItem
private
System.Windows.Forms.ToolStripMenuItem SSQLE.Editor.fileToolStripMenuItem
private
int SSQLE.Editor.historyIndex
private

Index to history commands. See CommandsHistory.

System.Windows.Forms.ToolStripMenuItem SSQLE.Editor.loadQueryToolStripMenuItem
private
System.Windows.Forms.MenuStrip SSQLE.Editor.menuBar
private
System.Windows.Forms.Panel SSQLE.Editor.panelBottom
private
System.Windows.Forms.Panel SSQLE.Editor.panelTop
private
System.Windows.Forms.ToolStripMenuItem SSQLE.Editor.queryToolStripMenuItem
private
System.Windows.Forms.ToolStripMenuItem SSQLE.Editor.resultToolStripMenuItem
private
System.Windows.Forms.ToolStripMenuItem SSQLE.Editor.saveToolStripMenuItem
private
ScintillaNET.Scintilla SSQLE.Editor.scintillaInput
private
ScintillaNET.Scintilla SSQLE.Editor.scintillaResults
private
System.Windows.Forms.SplitContainer SSQLE.Editor.splitContainer
private
System.Windows.Forms.StatusStrip SSQLE.Editor.statusBar
private
System.Windows.Forms.ToolStripStatusLabel SSQLE.Editor.statusBarLabel
private
System.Windows.Forms.ToolTip SSQLE.Editor.tooltip_execute
private

The documentation for this class was generated from the following files: