C# Класс _3PA.MainFeatures.AutoCompletion.AutoComplete

This class handles the AutoCompletionForm
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
OnInsertSuggestion void
RememberUseOf void
SetCurrentItems void
ShowSuggestionList void

Открытые методы

Метод Описание
Close ( ) : void

Closes the form

CorrectKeywordCase ( string keyword, int lastWordPos ) : string

Returns a keyword from the autocompletion list with the correct case

FindInCompletionData ( string keyword, int position, bool dontCheckLine = false ) : List

Find a list of items in the completion and return it Uses the position to filter the list the same way the autocompletion form would

FindInSavedItems ( string keyword, int line ) : CompletionItem

try to match the keyword with an item in the autocomplete list

FindRankingOfDatabaseItem ( string displayText ) : int

Find ranking of a database item

FindRankingOfParsedItem ( string displayText ) : int

Find ranking of a parsed item

ForceClose ( ) : void

Forces the form to close, only when leaving npp

GetCurrentSuggestion ( ) : CompletionItem

returns the keyword currently selected in the completion list

IsMouseIn ( ) : bool

Returns true if the cursor is within the form window

OnKeyDown ( Keys key ) : bool

Passes the OnKey input of the CharAdded or w/e event to the auto completion form

OnShowCompleteSuggestionList ( ) : void

Called from CTRL + Space shortcut

RefreshDynamicItems ( ) : void

Method called when the event OnParseEnded triggers, i.e. when we just parsed the document and need to refresh the autocompletion

RefreshStaticItems ( ) : void

this method should be called at the plugin's start and when we change the current database It refreshed the "static" items of the autocompletion : keywords, snippets, databases, tables, sequences

RememberUseOfDatabaseItem ( string displayText ) : void

remember the use of a particular item in the completion list (for database items!)

RememberUseOfParsedItem ( string displayText ) : void

remember the use of a particular item in the completion list (for dynamic items = parsed items)

UpdateAutocompletion ( ) : void

Updates the CURRENT ITEMS LIST, handles the opening or the closing of the autocompletion form on key input, it is only called when the user adds or delete a char

Приватные методы

Метод Описание
OnInsertSuggestion ( CompletionItem data ) : void

Method called by the form when the user accepts a suggestion (tab or enter or doubleclick)

RememberUseOf ( CompletionItem item ) : void

Increase ranking of a given CompletionItem

SetCurrentItems ( List currentItems ) : void

Set the list of current items, handles the lock

ShowSuggestionList ( string keyword ) : void

This function handles the display of the autocomplete form, create or update it

Описание методов

Close() публичный статический Метод

Closes the form
public static Close ( ) : void
Результат void

CorrectKeywordCase() публичный статический Метод

Returns a keyword from the autocompletion list with the correct case
public static CorrectKeywordCase ( string keyword, int lastWordPos ) : string
keyword string
lastWordPos int
Результат string

FindInCompletionData() публичный статический Метод

Find a list of items in the completion and return it Uses the position to filter the list the same way the autocompletion form would
public static FindInCompletionData ( string keyword, int position, bool dontCheckLine = false ) : List
keyword string
position int
dontCheckLine bool
Результат List

FindInSavedItems() публичный статический Метод

try to match the keyword with an item in the autocomplete list
public static FindInSavedItems ( string keyword, int line ) : CompletionItem
keyword string
line int
Результат CompletionItem

FindRankingOfDatabaseItem() публичный статический Метод

Find ranking of a database item
public static FindRankingOfDatabaseItem ( string displayText ) : int
displayText string
Результат int

FindRankingOfParsedItem() публичный статический Метод

Find ranking of a parsed item
public static FindRankingOfParsedItem ( string displayText ) : int
displayText string
Результат int

ForceClose() публичный статический Метод

Forces the form to close, only when leaving npp
public static ForceClose ( ) : void
Результат void

GetCurrentSuggestion() публичный статический Метод

returns the keyword currently selected in the completion list
public static GetCurrentSuggestion ( ) : CompletionItem
Результат CompletionItem

IsMouseIn() публичный статический Метод

Returns true if the cursor is within the form window
public static IsMouseIn ( ) : bool
Результат bool

OnKeyDown() публичный статический Метод

Passes the OnKey input of the CharAdded or w/e event to the auto completion form
public static OnKeyDown ( Keys key ) : bool
key Keys
Результат bool

OnShowCompleteSuggestionList() публичный статический Метод

Called from CTRL + Space shortcut
public static OnShowCompleteSuggestionList ( ) : void
Результат void

RefreshDynamicItems() публичный статический Метод

Method called when the event OnParseEnded triggers, i.e. when we just parsed the document and need to refresh the autocompletion
public static RefreshDynamicItems ( ) : void
Результат void

RefreshStaticItems() публичный статический Метод

this method should be called at the plugin's start and when we change the current database It refreshed the "static" items of the autocompletion : keywords, snippets, databases, tables, sequences
public static RefreshStaticItems ( ) : void
Результат void

RememberUseOfDatabaseItem() публичный статический Метод

remember the use of a particular item in the completion list (for database items!)
public static RememberUseOfDatabaseItem ( string displayText ) : void
displayText string
Результат void

RememberUseOfParsedItem() публичный статический Метод

remember the use of a particular item in the completion list (for dynamic items = parsed items)
public static RememberUseOfParsedItem ( string displayText ) : void
displayText string
Результат void

UpdateAutocompletion() публичный статический Метод

Updates the CURRENT ITEMS LIST, handles the opening or the closing of the autocompletion form on key input, it is only called when the user adds or delete a char
public static UpdateAutocompletion ( ) : void
Результат void