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

Represents settings of single connection profile. More...

Classes

class  TextSettings
 Class representing settings of text in highlighing component Scintilla.NET It allows to define Color, boldness and italics for the text. More...
 
class  XmlDocumentCreator
 Wrapper class around XmlDocument providing simple adding of Nodes and attributes to XmlDocument. More...
 

Public Member Functions

void AddExecutedCommand (string command)
 Adds executed command to the history. More...
 
void SaveQuery (string name, string query)
 Saves query snippet to the profile. More...
 

Static Public Member Functions

static Settings LoadFromXml (Stream stream)
 Loads Settings from stream containing XML document with settings. More...
 
static void SaveToXml (Settings settings)
 Saves the settings to a file given by Path More...
 
static string GetXmlPathFromName (string name)
 Gets path to XML file of settings from the profile name. More...
 

Public Attributes

string Path => GetXmlPathFromName(Name)
 Returns path to the file representing this Settings. More...
 
CommandsHistory CommandsHistory = new CommandsHistory(MaxCommandHistory)
 History of previously executed commands. More...
 
IDictionary< string, string > Snippets = new Dictionary<string, string>()
 Snippets stored in the profile. More...
 
const string SettingsPath = "settings/"
 Directory containing settings. More...
 
const string XsdSchema = "settings.xsd"
 XML Schema file used to validate XML documents with setings. More...
 
const string XmlExtension = ".xml"
 Extension used for XML files. More...
 

Properties

string Name [get, set]
 Name of the profile. More...
 
string Host = "" [get, set]
 Hostname to be used while connecting to database. More...
 
string User = "" [get, set]
 Username to be used while connecting to database. More...
 
string Pass = "" [get, set]
 Username to be used while connecting to database. More...
 
string Sid = "" [get, set]
 SID to be used while connecting to database. More...
 
string Port = "" [get, set]
 Port to be used while connecting to database. More...
 
TextSettings KeyWord = "1521" [get, private set]
 TextSettingsused for SQL keywords. More...
 
TextSettings Function = new TextSettings(true, false, ColorExtensions.FromString("purple")) [get, private set]
 TextSettingsused for function calls. More...
 
TextSettings Comment = new TextSettings(false, false, ColorExtensions.FromString("#569CD6")) [get, private set]
 TextSettingsused for comments. More...
 
TextSettings StringLiteral = new TextSettings(false, false, ColorExtensions.FromString("#57A64A")) [get, private set]
 TextSettingsused for string literals. More...
 
TextSettings NumberLiteral = new TextSettings(false, false, ColorExtensions.FromString("red")) [get, private set]
 TextSettings used for number literals. More...
 

Private Member Functions

 Settings ()
 Private constructor. Is to be created using LoadFromXml. More...
 

Static Private Member Functions

static IDictionary< string,
string > 
GetSnippetsFromXPath (XmlDocument document, string xpath)
 Returns mapping of saved queries from document located using XPath expression. More...
 
static CommandsHistory GetCommandsHistoryFromXPath (XmlDocument document, string xpath)
 Returns CommandsHistory from document located using XPath expression. More...
 
static string GetSettingsFromXPath (XmlDocument document, string xpath)
 Returns inner text of node selected by XPath expression in document. More...
 

Private Attributes

const int MaxCommandHistory = 100
 Maximum command to be stored at once in history. More...
 

Static Private Attributes

static XmlSchema schema
 XML Schema once it is loaded in LoadFromXml. More...
 

Detailed Description

Represents settings of single connection profile.

Constructor & Destructor Documentation

SSQLE.Settings.Settings ( )
private

Private constructor. Is to be created using LoadFromXml.

Member Function Documentation

void SSQLE.Settings.AddExecutedCommand ( string  command)

Adds executed command to the history.

Parameters
commandCommand to add to history.
static CommandsHistory SSQLE.Settings.GetCommandsHistoryFromXPath ( XmlDocument  document,
string  xpath 
)
staticprivate

Returns CommandsHistory from document located using XPath expression.

Parameters
documentXmlDocument containing settings.
xpathXPath expression.
Returns
CommandsHistory of the profile.
static string SSQLE.Settings.GetSettingsFromXPath ( XmlDocument  document,
string  xpath 
)
staticprivate

Returns inner text of node selected by XPath expression in document.

Parameters
documentXmlDocument
xpathXPath expression.
Returns
Inner text representing the settings.
static IDictionary<string, string> SSQLE.Settings.GetSnippetsFromXPath ( XmlDocument  document,
string  xpath 
)
staticprivate

Returns mapping of saved queries from document located using XPath expression.

Parameters
documentXmlDocument containing settings.
xpathXPath expression.
Returns
Dictionary<string, string> of saved queries in the profile. Key is name, Value is query.
static string SSQLE.Settings.GetXmlPathFromName ( string  name)
static

Gets path to XML file of settings from the profile name.

Parameters
nameName of the profile.
Returns
Text containing path to file of settings.
static Settings SSQLE.Settings.LoadFromXml ( Stream  stream)
static

Loads Settings from stream containing XML document with settings.

Parameters
streamStream containing the XML with settings or null.
Returns
Settings loaded from stream or default settings, if stream is null.
Exceptions
SettingsLoadExceptionWhen XML is not valid according to settings.xsd. See documentatin of settings.xsd on main page.
void SSQLE.Settings.SaveQuery ( string  name,
string  query 
)

Saves query snippet to the profile.

Parameters
nameName of the snippet.
queryActuall query.
static void SSQLE.Settings.SaveToXml ( Settings  settings)
static

Saves the settings to a file given by Path

Parameters
settingsSettings to save.
Exceptions
SettingsSaveExceptionIf settings are not valid.

Member Data Documentation

CommandsHistory SSQLE.Settings.CommandsHistory = new CommandsHistory(MaxCommandHistory)

History of previously executed commands.

const int SSQLE.Settings.MaxCommandHistory = 100
private

Maximum command to be stored at once in history.

string SSQLE.Settings.Path => GetXmlPathFromName(Name)

Returns path to the file representing this Settings.

XmlSchema SSQLE.Settings.schema
staticprivate

XML Schema once it is loaded in LoadFromXml.

const string SSQLE.Settings.SettingsPath = "settings/"

Directory containing settings.

IDictionary<string, string> SSQLE.Settings.Snippets = new Dictionary<string, string>()

Snippets stored in the profile.

const string SSQLE.Settings.XmlExtension = ".xml"

Extension used for XML files.

const string SSQLE.Settings.XsdSchema = "settings.xsd"

XML Schema file used to validate XML documents with setings.

Property Documentation

TextSettings SSQLE.Settings.Comment = new TextSettings(false, false, ColorExtensions.FromString("#569CD6"))
getprivate set

TextSettingsused for comments.

TextSettings SSQLE.Settings.Function = new TextSettings(true, false, ColorExtensions.FromString("purple"))
getprivate set

TextSettingsused for function calls.

string SSQLE.Settings.Host = ""
getset

Hostname to be used while connecting to database.

TextSettings SSQLE.Settings.KeyWord = "1521"
getprivate set

TextSettingsused for SQL keywords.

string SSQLE.Settings.Name
getset

Name of the profile.

TextSettings SSQLE.Settings.NumberLiteral = new TextSettings(false, false, ColorExtensions.FromString("red"))
getprivate set

TextSettings used for number literals.

string SSQLE.Settings.Pass = ""
getset

Username to be used while connecting to database.

string SSQLE.Settings.Port = ""
getset

Port to be used while connecting to database.

string SSQLE.Settings.Sid = ""
getset

SID to be used while connecting to database.

TextSettings SSQLE.Settings.StringLiteral = new TextSettings(false, false, ColorExtensions.FromString("#57A64A"))
getprivate set

TextSettingsused for string literals.

string SSQLE.Settings.User = ""
getset

Username to be used while connecting to database.


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