Class EditorWebViewDotnetInterop

Class that is called from browser JavaScript to interact with the Markdown Monster UI/Editor

System.Object
  MarkdownMonster.Windows.EditorWebViewDotnetInterop
public class EditorWebViewDotnetInterop : object

Class Members

MemberDescription

Constructor

CheckSpelling

Check spelling of an individual word - called from ACE Editor

public bool CheckSpelling(string text,     string language,     bool reload)

CopyOperation

Handles copying from the current selection. Explict to always force content to \r\n to avoid potential failures with \n to editors that don't support \n only.

public Task CopyOperation()

CutOperation

public Task CutOperation()

EmbedDroppedFileAsImage

Embeds a dropped file as an image. If not an image no action is taken

public Task EmbedDroppedFileAsImage(string file)

GetKeyBindingsJson

Return keyboard bindings object as a JSON string so we can bind inside of the editor JavaScript

public string GetKeyBindingsJson()

GetSuggestions

Shows spell check context menu options

public Task GetSuggestions(string text,     string language,     bool reload,     string jsonRange)

GotFocus

ACE Editor Notification when focus is set to the editor

public Task GotFocus()

InitializeInterop

Initial call into JavaScript. Sync call that doesn't wait and doesn't resync to current thread

public void InitializeInterop()

InitializeInteropAsync

Intial Call into JavaScript

public Task InitializeInteropAsync()

IsDirty

public bool IsDirty(bool previewIfDirty,     string markdown)

IsPreviewToEditorSync

Checks to see if the editor and preview are synced and if scrolling the preview needs to scroll the editor.

public bool IsPreviewToEditorSync()

KeyboardCommand

Performs the special key operation that is tied to the key in the application.

ctrl-s,ctrl-n, ctrl-o, cltr-i,ctrl-b,ctrl-l,ctrl-k,alt-c,ctrl-shift-v,ctrl-shift-c,ctlr-shift-down,ctrl-shift-up

public Task KeyboardCommand(string key,     string action)

LostFocus

ACE Editor Notification when focus is lost

public Task LostFocus()

PasteOperation

Handle pasting and handle images

public Task PasteOperation()

PreviewContextMenu

Shows the WPF Preview menu

public Task PreviewContextMenu(string positionAndElementType)

PreviewLinkNavigation

Fired when a link is clicked in the preview editor. Opens a new external browser instance with the URL opened or opens certain supported files (like other markdown files) in the editor.

public Task PreviewLinkNavigation(string url,     string src)

PreviewMarkdownCallback

Callback handler callable from JavaScript editor

public Task PreviewMarkdownCallback(bool dontGetMarkdown,     int editorLineNumber,     bool noPreviewScrolling)

RestyleEditor

public Task RestyleEditor(bool forceSync,     bool initialize)

ScrollPreviewToEditorLineCallback

Scrolls the preview editor - typically in response to editor scroll or click operations based on the PreviewSyncMode setting

public Task ScrollPreviewToEditorLineCallback(int editorLineNumber,     bool updateCodeBlocks,     bool noScrollTimeout,     bool noScrollTopAdjustment)

SetEditorFocus

public Task SetEditorFocus()

Test

public string Test()

TriggerWindowAltMenu

Call this to trigger the Alt-Window command to show underlines and activate the Window to navigate the shortcut menus.

Client code calls this after short alt-key delay from OnKey Handler.

public Task TriggerWindowAltMenu()

UpdateDocumentStats

Callback to force updating of the status bar document stats

public Task UpdateDocumentStats(string jsonStats)

JsInterop

Optional reference to the JavaScript interop that allows calling into JavaScript from .NET code.

Provided primarily as a helper to make it easier to access JS code internally as well as for .NET browser initialization code which needs both directions of Interop.

Window

Requirements

Namespace: MarkdownMonster.Windows
Assembly: markdownmonster.exe

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