C# Class hoTools.Query.SqlTabPagesCntrl

SqlTabPagesCntrl creates and handles TabPages of a ControlTab to work with *.sql files. - Create Menu Items -- Templates SQL -- Templates Macros - Events - SQL File properties
ファイルを表示 Open project: Helmut-Ortmann/EnterpriseArchitect_hoTools Class Usage Examples

Public Properties

Property Type Description
MenuLoadTabFileText string
MenuLoadTabFileTooltip string
MenuLoadTabFromRecentFileText string
MenuLoadTabFromRecentFileTooltip string
MenuNewTabFromRecentText string
MenuNewTabFromRecentTooltip string
MenuNewTabText string
MenuNewTabTooltip string
MenuNewTabWithFileDialogText string
MenuNewTabWithFileDialogTooltip string
MenuReLoadTabText string
MenuReLoadTabTooltip string

Public Methods

Method Description
AddTab ( ) : TabPage

Add an Tab to the tab control and load the Element Template as default. The Text box is unchanged because it's just a template.

AddTab ( string content ) : TabPage

Add a tab to the tab control and load content into the tab.If the content is empty nothing is loaded.

AddTabWithFileDialog ( ) : TabPage

Add Tab with file dialog to load file

Close ( TabPage tabPage ) : void

Close TabPage - Ask to store content if changed

CloseAll ( ) : void

Close all Tab Pages

LoadTabPagePerFileDialog ( ) : void

Load sql string from *.sql File into active TabPage with TextBox inside. - Update and save the list of sql files

RedoText ( ) : void

Redo changes in current active TextBoxUndo

ReloadTabPage ( ) : void

Reload current Tab

ReloadTabPageWithAsk ( ) : void

Reload current tab and ask if the user wants it. It checks the file for differences before asking.

RunSqlTabPage ( ) : void

Run SQL for selected TabPage

Save ( bool configSave = true ) : void

Save current active TabPage

SaveAll ( ) : void

Save all unchanged Tabs.

SaveAs ( ) : void

Save sql Tab As...

SaveSqlTabAs ( ) : void

Save current Tab into desired file

SqlTabPagesCntrl ( Model model, AddinSettings settings, System components, TabControl tabControl, TextBox sqlTextBoxSearchTerm, ToolStripMenuItem fileNewTabAndLoadRecentFileMenuItem, ToolStripMenuItem fileLoadTabRecentFileMenuItem, string addinTabName ) : System

Constructor to Initialize TabControl, create ToolStripItems (New Tab from, Recent Files) with file history.

UndoText ( ) : void

Undo changes in current active TextBoxUndo

Private Methods

Method Description
BranchConstantPackageTemplateText ( SqlTemplate template, string templateText ) : string

Insert Branch for a constant package like: '#Branch={.....guid...}'. If the context Element is a package it inserts the Package Id.

GetMacroMenuItems ( ) : ToolStripMenuItem

Get Macro Menu Items. Every item contains: - Macro name - Tooltip - Tag Template - Event Handler insertTemplate_Click

GetTemplateMenuItems ( ) : ToolStripMenuItem

Get Template Menu Items. Every item contains: - Template name - Tooltip - Tag Template - Event Handler insertTemplate_Click

GuidConstant ( SqlTemplate template, string templateText ) : string

Returns guid of it selected and has a supported type (Package, Diagram, Element, Attribute, Operation)

IdConstant ( SqlTemplate template, string templateText ) : string

Returns string of id of it selected and has a supported type (Package, Diagram, Element, Attribute, Operation).It also copies the id to Clipboard.

InsertRecentFileLists ( string fileName ) : void

Insert recent file lists - SqlFile -OpenedTabs

LoadOpenedTabsFromLastSession ( ) : void

Load all tabs which were opened in the last session

LoadRecentFilesIntoToolStripItems ( ) : void

Update the following Menu Items with recent files: -File, Load Tab from.. -File, Add Tab from.. -Tab, Load Tab from.. -Tab, Add Tab from..

LoadRecentFilesMenuItems ( ToolStripMenuItem loadRecentFileStripMenuItem, EventHandler eventHandlerClick ) : void

Load RecentFiles MenuItems into MenuItemStrip

LoadTabPage ( string tabContent ) : void

Load string for tab Page

LoadTabPageFromFile ( TabPage tabPage, string fileName, bool notUpdateLastOpenedList = false ) : void

Load file for tab Page

Save ( TabPage tabPage, bool configSave = true ) : void

Save sql TabPage in *.sql File. Store the save time to distinguish hoTools writes from other

SaveAs ( TabPage tabPage ) : void

Save As... TabPage in *.sql File.

ToolstripMenuItemInsertTemplateFromId ( SqlTemplates id, string caption ) : ToolStripMenuItem

New ToolStripItem to insert a template. The EventHandler is: insertTemplate_Click. It sets: Caption text, Tooltip, EventHandler, Tag with the template itself

addTabFileDialogMenuItem_Click ( object sender, EventArgs e ) : void

Add Tab with File Dialog

addTabMenuItem_Click ( object sender, EventArgs e ) : void

Add tab fired by TabControl or TabPage

closeMenuItem_Click ( object sender, EventArgs e ) : void

Event Close TabPage

fileLoadMenuItem_Click ( object sender, EventArgs e ) : void

Event File Load fired by TabControl

fileRunMenuItem_Click ( object sender, EventArgs e ) : void
fileRunSelectedMenuItem_Click ( object sender, EventArgs e ) : void

Run sql for selected Text

fileSaveAllMenuItem_Click ( object sender, EventArgs e ) : void

Event File Save

fileSaveAsMenuItem_Click ( object sender, EventArgs e ) : void

Event File Save As

fileSaveMenuItem_Click ( object sender, EventArgs e ) : void

Event File Save

insertTemplate_Click ( object sender, EventArgs e ) : void

Inserts the selected macro at the cursor position or replace the selected text by the macro. The template is identified by the .Tag property of the menuItem passed by the sender parameter.

loadFromHistoryEntry_Click ( object sender, EventArgs e ) : void

Load from history item in active tab. If no active tab exists create one.

newTabAndLoadFromHistoryEntry_Click ( object sender, EventArgs e ) : void

New Tab and Load from history item

reLoadTabMenuItem_Click ( object sender, EventArgs e ) : void
sqlTextBox_KeyUp ( object sender, KeyEventArgs e ) : void

Handle CTRL sequences for CTRL+S (Store sql) and CTRL+R (RUN sql)

Method Details

AddTab() public method

Add an Tab to the tab control and load the Element Template as default. The Text box is unchanged because it's just a template.
public AddTab ( ) : TabPage
return System.Windows.Forms.TabPage

AddTab() public method

Add a tab to the tab control and load content into the tab.If the content is empty nothing is loaded.
public AddTab ( string content ) : TabPage
content string Content of the Tab
return System.Windows.Forms.TabPage

AddTabWithFileDialog() public method

Add Tab with file dialog to load file
public AddTabWithFileDialog ( ) : TabPage
return System.Windows.Forms.TabPage

Close() public method

Close TabPage - Ask to store content if changed
public Close ( TabPage tabPage ) : void
tabPage System.Windows.Forms.TabPage
return void

CloseAll() public method

Close all Tab Pages
public CloseAll ( ) : void
return void

LoadTabPagePerFileDialog() public method

Load sql string from *.sql File into active TabPage with TextBox inside. - Update and save the list of sql files
public LoadTabPagePerFileDialog ( ) : void
return void

RedoText() public method

Redo changes in current active TextBoxUndo
public RedoText ( ) : void
return void

ReloadTabPage() public method

Reload current Tab
public ReloadTabPage ( ) : void
return void

ReloadTabPageWithAsk() public method

Reload current tab and ask if the user wants it. It checks the file for differences before asking.
public ReloadTabPageWithAsk ( ) : void
return void

RunSqlTabPage() public method

Run SQL for selected TabPage
public RunSqlTabPage ( ) : void
return void

Save() public method

Save current active TabPage
public Save ( bool configSave = true ) : void
configSave bool Default: true, whether to store the configuration
return void

SaveAll() public method

Save all unchanged Tabs.
public SaveAll ( ) : void
return void

SaveAs() public method

Save sql Tab As...
public SaveAs ( ) : void
return void

SaveSqlTabAs() public method

Save current Tab into desired file
public SaveSqlTabAs ( ) : void
return void

SqlTabPagesCntrl() public method

Constructor to Initialize TabControl, create ToolStripItems (New Tab from, Recent Files) with file history.
public SqlTabPagesCntrl ( Model model, AddinSettings settings, System components, TabControl tabControl, TextBox sqlTextBoxSearchTerm, ToolStripMenuItem fileNewTabAndLoadRecentFileMenuItem, ToolStripMenuItem fileLoadTabRecentFileMenuItem, string addinTabName ) : System
model EAAddinFramework.Utils.Model
settings hoTools.Settings.AddinSettings
components System
tabControl System.Windows.Forms.TabControl
sqlTextBoxSearchTerm System.Windows.Forms.TextBox
fileNewTabAndLoadRecentFileMenuItem System.Windows.Forms.ToolStripMenuItem File, New Tab from recent files
fileLoadTabRecentFileMenuItem System.Windows.Forms.ToolStripMenuItem File, Load Tab from recent files
addinTabName string
return System

UndoText() public method

Undo changes in current active TextBoxUndo
public UndoText ( ) : void
return void

Property Details

MenuLoadTabFileText public_oe static_oe property

public static string MenuLoadTabFileText
return string

MenuLoadTabFileTooltip public_oe static_oe property

public static string MenuLoadTabFileTooltip
return string

MenuLoadTabFromRecentFileText public_oe static_oe property

public static string MenuLoadTabFromRecentFileText
return string

MenuLoadTabFromRecentFileTooltip public_oe static_oe property

public static string MenuLoadTabFromRecentFileTooltip
return string

MenuNewTabFromRecentText public_oe static_oe property

public static string MenuNewTabFromRecentText
return string

MenuNewTabFromRecentTooltip public_oe static_oe property

public static string MenuNewTabFromRecentTooltip
return string

MenuNewTabText public_oe static_oe property

public static string MenuNewTabText
return string

MenuNewTabTooltip public_oe static_oe property

public static string MenuNewTabTooltip
return string

MenuNewTabWithFileDialogText public_oe static_oe property

public static string MenuNewTabWithFileDialogText
return string

MenuNewTabWithFileDialogTooltip public_oe static_oe property

public static string MenuNewTabWithFileDialogTooltip
return string

MenuReLoadTabText public_oe static_oe property

public static string MenuReLoadTabText
return string

MenuReLoadTabTooltip public_oe static_oe property

public static string MenuReLoadTabTooltip
return string