C# Class RpgCodeExpress.CodeEditor

Inheritance: EditorForm, ISaveable
ファイルを表示 Open project: rpgtoolkit/rpgcodeexpress Class Usage Examples

Public Methods

Method Description
CodeEditor ( ) : System

Creates a blank code editor.

CodeEditor ( string file, RPGcode currentRpgCode ) : System

Creates a code editor and opens a file.

Save ( ) : bool

Saves a file that already exists, otherwise it will call SaveAs().

SaveAs ( ) : bool

Displays a SaveFileDialog and allow the user to save the file. Possibly a redundant routine at the moment.

Protected Methods

Method Description
OnCaretUpdated ( CaretPositionUpdateEventArgs e ) : void
OnUndoRedoUpdated ( UndoRedoUpdateEventArgs e ) : void

Private Methods

Method Description
AddFileDeclarations ( ) : void

Adds all the imported autocomplete items to popup menu.

AddFileIncludes ( ) : void

Looks for included files, and adds a reference to them.

AddGlobalsToObjectExplorer ( ) : void

Adds all of the globals declared in this RPGCode program to the Object Explorer.

AddMembersToObjectExplorer ( ) : void

Adds all of the members declared in this RPGCode program to the Object Explorer.

AddMethodsToObjectExplorer ( ) : void

Adds all of the methods declared in this RPGCode program to the Object Explorer.

BuildAutocompleteMenu ( ) : void

Populates the code editor's auto complete menu, it runs through a series of loops assigning data to the individual AutocompleteItems.

CancelTooltip ( ) : void

Stops the tooltip timer and tooltips for hoverwords.

ClearFileIncludes ( ) : void

Clears all of the "Included" auto complete items.

CodeEditor_FormClosing ( object sender, FormClosingEventArgs e ) : void
CodeEditor_Load ( object sender, EventArgs e ) : void
FindClassMembers ( string text ) : MatchCollection

Finds all of the member variables in a string of RPGCode, and returns any matches.

FindClasses ( string text ) : MatchCollection

Finds all of the classes in a string of RPGCode, and returns any matches.

FindGlobalVariables ( string text ) : MatchCollection

Finds all of the global variables in a string of RPGCode, and returns any matches.

FindLocalVariables ( string text ) : MatchCollection

Finds all of the local variables in a string of RPGCode, and returns any matches.

FindMethods ( string text ) : MatchCollection

Finds all of the methods in a string of RPGCode, and returns any matches.

GetDefinedClassMembers ( string text ) : List

Get all of defined class members in this RPGCode program for use in the autocomplete menu.

GetDefinedClasses ( string text ) : List

Get all of defined classes in this RPGCode program for use in the autocomplete menu.

GetDefinedGlobalVariables ( string text ) : List

Get all of defined globals in this RPGCode program for use in the autocomplete menu.

GetDefinedLocalVariables ( string text ) : List

Get all of defined locals in this RPGCode program for use in the autocomplete menu.

GetDefinedMethods ( string text ) : List

Get all of defined methods in this RPGCode program for use in the autocomplete menu.

PopulateClassExplorer ( ) : void

Populates the Class Explorer combobox, taking all of the defined class declarations from the current document using a regular expression.

PopulateObjectExplorer ( ) : void

Populates the Object Explorer by calling a number of sub-methods, it then sorts the results from these methods alphabetically.

ReadFile ( ) : void

Reads the contents of a file into the code editor.

ReadIncludedFile ( string file ) : void

Reads the text from the included file.

UpdateFile ( ) : DialogResult

Prompts the user to save a file that needs updating, they can choose to cancel their action.

WriteToFile ( ) : void

Writes the text in the code editor to a file.

cboClassExplorer_DrawItem ( object sender, DrawItemEventArgs e ) : void
cboClassExplorer_Enter ( object sender, EventArgs e ) : void
cboClassExplorer_SelectedIndexChanged ( object sender, EventArgs e ) : void
cboObjectExplorer_DrawItem ( object sender, DrawItemEventArgs e ) : void
cboObjectExplorer_Enter ( object sender, EventArgs e ) : void
cboObjectExplorer_SelectedIndexChanged ( object sender, EventArgs e ) : void
mnuItemCommentSelected_Click ( object sender, EventArgs e ) : void
mnuItemCopy_Click ( object sender, EventArgs e ) : void
mnuItemCut_Click ( object sender, EventArgs e ) : void
mnuItemFind_Click ( object sender, EventArgs e ) : void
mnuItemPaste_Click ( object sender, EventArgs e ) : void
mnuItemRedo_Click ( object sender, EventArgs e ) : void
mnuItemReplace_Click ( object sender, EventArgs e ) : void
mnuItemSelectAll_Click ( object sender, EventArgs e ) : void
mnuItemUncommandSlected_Click ( object sender, EventArgs e ) : void
mnuItemUndo_Click ( object sender, EventArgs e ) : void
popupMenu_Opening ( object sender, CancelEventArgs e ) : void
tmrCommandTooltip_Tick ( object sender, EventArgs e ) : void
txtCodeEditor_KeyDown ( object sender, KeyEventArgs e ) : void
txtCodeEditor_MouseLeave ( object sender, EventArgs e ) : void
txtCodeEditor_MouseMove ( object sender, MouseEventArgs e ) : void
txtCodeEditor_SelectionChanged ( object sender, EventArgs e ) : void
txtCodeEditor_SelectionChangedDelayed ( object sender, EventArgs e ) : void
txtCodeEditor_TextChangedDelayed ( object sender, TextChangedEventArgs e ) : void
txtCodeEditor_UndoRedoStateChanged ( object sender, EventArgs e ) : void

Method Details

CodeEditor() public method

Creates a blank code editor.
public CodeEditor ( ) : System
return System

CodeEditor() public method

Creates a code editor and opens a file.
public CodeEditor ( string file, RPGcode currentRpgCode ) : System
file string File path.
currentRpgCode RpgCodeExpress.RpgCode.RPGcode RPGCode autocomplete items.
return System

OnCaretUpdated() protected method

protected OnCaretUpdated ( CaretPositionUpdateEventArgs e ) : void
e CaretPositionUpdateEventArgs
return void

OnUndoRedoUpdated() protected method

protected OnUndoRedoUpdated ( UndoRedoUpdateEventArgs e ) : void
e UndoRedoUpdateEventArgs
return void

Save() public method

Saves a file that already exists, otherwise it will call SaveAs().
public Save ( ) : bool
return bool

SaveAs() public method

Displays a SaveFileDialog and allow the user to save the file. Possibly a redundant routine at the moment.
public SaveAs ( ) : bool
return bool