C# Class JoelSpadin.BraceCompleter.BraceCompleterCommandHandler

Implements brace completion
Inheritance: IOleCommandTarget
Datei anzeigen Open project: ChaosinaCan/BraceCompleter

Public Methods

Method Description
BraceCompleterCommandHandler ( IVsTextView textViewAdapter, IWpfTextView textView, IEditorOperations operations, ITextUndoHistory undoHistory ) : System
Exec ( System.Guid &pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvalIn, IntPtr pvalOut ) : int
QueryStatus ( System.Guid &pguidCmdGroup, uint cCmds, OLECMD prgCmds, IntPtr pCmdText ) : int

Private Methods

Method Description
CloseCurlyBrace ( ) : void
CloseCurlyBraceGeneric ( ) : void

Drops the caret to the next line and adds a closing brace on the line after that.

CloseCurlyBraceImmediate ( ) : void

Adds a closing brace immediately after an opening brace.

CloseCurlyBraceSmartFormat ( ) : void

Inserts a closing brace, then runs VS' Smart Format on the code block and repositions the cursor

GetSelection ( ) : string

Gets the text currently selected

IsCaretSamePosition ( ) : bool

Returns true if the caret is in the same position as it was when SaveCaretPosition was called

IsNextCharClosingBrace ( ) : bool

Returns true if the character to the right of the caret is a closing brace

IsNextCharImmediateBrace ( ) : bool

Returns true if the next character after the caret is the automatically added closing brace

IsNextLineClosingBrace ( ) : bool

Returns true if the text on the next line is a closing brace

IsOpenBraceOnNewLine ( ) : bool
IsPreviousCharOpeningBrace ( ) : bool

Returns true if the character to the left of the caret is an opening brace

LoadSettings ( ) : void

Loads settings from Visual Studio

NeedsJavaScriptHack ( ) : bool

Determines whether the code to the left of the cursor is an anonymous function which is not being assigned to any variable or part of a try block.

ProcessBackspaceKey ( ) : bool
ProcessCharInput ( char typedChar ) : bool
ProcessDeleteOrUndoKey ( ) : bool
ProcessInput ( uint nCmdID, IntPtr pvalIn ) : bool
ProcessReturnKey ( ) : bool
RemoveCurlyBraceImmediate ( ) : void

Undoes the brace added by CloseCurlyBraceImmediate

SaveCaretPosition ( ) : void

Save the position of the caret for IsCaretSamePosition

SaveImmediateBracePosition ( ) : void

Save the position of the caret after adding an immediate closing brace

TextView_GotFocus ( object sender, EventArgs e ) : void

Checks whether the options have been updated when the textview receives focus

Method Details

BraceCompleterCommandHandler() public method

public BraceCompleterCommandHandler ( IVsTextView textViewAdapter, IWpfTextView textView, IEditorOperations operations, ITextUndoHistory undoHistory ) : System
textViewAdapter IVsTextView
textView IWpfTextView
operations IEditorOperations
undoHistory ITextUndoHistory
return System

Exec() public method

public Exec ( System.Guid &pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvalIn, IntPtr pvalOut ) : int
pguidCmdGroup System.Guid
nCmdID uint
nCmdexecopt uint
pvalIn System.IntPtr
pvalOut System.IntPtr
return int

QueryStatus() public method

public QueryStatus ( System.Guid &pguidCmdGroup, uint cCmds, OLECMD prgCmds, IntPtr pCmdText ) : int
pguidCmdGroup System.Guid
cCmds uint
prgCmds OLECMD
pCmdText System.IntPtr
return int