Class EditorWebViewJavaScriptInterop

This class is used to call into the JavaScript document and perform operations there.

Note there's no inheritance/Composition as this interface requires Async operation, while the COM interface for WebBrowser control requires sync operation.

System.Object
  Westwind.WebView.Wpf.BaseJavaScriptInterop
    MarkdownMonster.Windows.EditorWebViewJavaScriptInterop
public class EditorWebViewJavaScriptInterop : BaseJavaScriptInterop

Class Members

MemberDescription

Constructor

AdjustPadding

public Task AdjustPadding(bool forceRefresh)

DeleteCurrentLine

public Task DeleteCurrentLine()

EnableSpellChecking

public Task EnableSpellChecking(bool enable,     string dictionary)

ExecCommand

Execute an ACE Editor Command with an optional parameter

public Task ExecCommand(string action,     string parm)

FindAndReplaceText

public Task FindAndReplaceText(string search,     string replace)

FindAndReplaceTextInCurrentLine

public Task FindAndReplaceTextInCurrentLine(string search,     string replace)

FindAndSelectTextInCurrentLine

Finds search text in the current line and if found selects it

public Task FindAndSelectTextInCurrentLine(string search)

FindText

Finds first match and displays it in the editor

public Task FindText(string search)

GetCurrentLine

Returns the text of the currently active line in the editor

public Task GetCurrentLine()

GetCursorPosition

Returns the current cursor position as an object

public Task GetCursorPosition()

GetFontSize

Returns a font object

public Task GetFontSize()

GetJsonStyleInfo

Gets a JSON string of all the settings that are exported to the ACE Editor instance when styling the editor.

public static string GetJsonStyleInfo(ApplicationConfiguration config)

GetLine

Returns the text of the currently active line in the editor

public Task GetLine(int row)

GetLineNumber

public Task GetLineNumber()

GetScrollPosition

Returns the editor's vertical scroll position

public Task GetScrollPosition()

GetScrollTop

Returns current editor scoll position

public Task GetScrollTop()

GetSelection

Gets the current text of the selection in the editor. If nothing is selected (ie. just a cursor) an empty string is returned.

public Task GetSelection()

GetSelectionRange

Returns the current selection as a Range Object with row column information.

public Task GetSelectionRange()

GetValue

Retrieves the Editor value

public Task GetValue()

GotoBottom

Goes to the bottom of the editor

public Task GotoBottom()

public Task GotoBottom(bool noRefresh,     bool noSelection)

GotoLine

Goes to the specific line in the editor

public Task GotoLine(int line,     bool noRefresh,     bool noSelection)

HasRedo

public Task HasRedo(object undoManager)

HasUndo

public Task HasUndo(object undoManager)

InitializeInterop

Initialize the document

public Task InitializeInterop(string jsonStyle)

MoveCursorDown

public Task MoveCursorDown(int count)

MoveCursorLeft

public Task MoveCursorLeft(int count)

MoveCursorRight

public Task MoveCursorRight(int count)

MoveCursorUp

public Task MoveCursorUp(int count)

OpenSearch

Opens the Editor's Search box and fills in the Search text

public Task OpenSearch(string searchText)

OpenSearchAndReplace

Opens the Search and Replace box and fills in the search and replace text

public Task OpenSearchAndReplace(string searchText,     string replaceText)

Redo

public Task Redo()

ReplaceContent

Replaces the content of the full document with new text using a selection.

public Task ReplaceContent(string text)

ReplaceSpellCheckRange

public Task ReplaceSpellCheckRange(string jsonRange,     string text)

SelectLine

Selects the entire line specified by the line number if line is smaller than 0 the current line is selected

public Task SelectLine(int row)

SetCodeScrolled

public Task SetCodeScrolled()

SetCursorPosition

Sets the cursor position

public Task SetCursorPosition(object pos)

public Task SetCursorPosition(int row,     int col)

SetEditorStyling

Method used to send Configuration to the editor. Sets things like font sizes, Word Wrap, padding etc. Called from Markdown Document.

public Task SetEditorStyling(string jsonStyleInfo)

SetFocus

public Task SetFocus()

SetLanguage

Sets the language syntax for the document

public Task SetLanguage(string syntax)

SetReadOnly

public Task SetReadOnly(bool show)

SetScrollPosition

Sets the vertical scroll position of the document

public Task SetScrollPosition(int top)

SetScrollTop

Sets scroll position from a scroll object (captured via COM)

public Task SetScrollTop(object scroll)

SetSelection

Sets the value of the current cursor insertion point. Either the cursor position or if selection is active replaces the entire selection with the text passed.

public Task SetSelection(string text)

SetSelectionRange

Selects the specified range of characters in the editor.

public Task SetSelectionRange(int startRow,     int startColumn,     int endRow,     int endColumn)

public Task SetSelectionRange(SelectionRange range)

SetSelPositionFromMouse

Forces the cursor position to be set to the mouse position.

public Task SetSelPositionFromMouse()

SetShowInvisibles

public Task SetShowInvisibles(bool show)

SetShowLineNumbers

public Task SetShowLineNumbers(bool show)

SetValue

Set the value of the Editor

public Task SetValue(string value,     object position,     bool keepUndoBuffer)

SetWordWrap

public Task SetWordWrap(bool enable)

ShowSuggestions

Forces suggestions to be shown for the currently spell error selected in the editor

public Task ShowSuggestions()

SpellCheckDocument

Spellchecks the document explicitly.

public Task SpellCheckDocument(bool force)

Split

Sets the editor split mode - Beside, Below, None

public Task Split(EditorSplitModes mode)

Undo

public Task Undo()

UpdateDocumentStats

Forces the editor to refresh the document statistics. Calls the editor to retrieve the stats and then pushes the changes into the MM shell to update the status bar

public Task UpdateDocumentStats()

IsDirty

This is a Write Only property that allows you to update the dirty status inside of the editor. This is not used frequently as the editor IsDirty flag is internally updated but if you need to force some action in the editor (like a spellcheck) to fire then this is the property to set.

Requirements

Namespace: MarkdownMonster.Windows
Assembly: markdownmonster.exe

© West Wind Technologies, 2016-2024 • Updated: 11/23/21
Comment or report problem with topic