Class ClipboardHelper

Helper to encode and set HTML fragment to clipboard.
See
MarkdownMonster.ClipboardHelper.CreateDataObject(System.String,System.String).

System.Object
  MarkdownMonster.ClipboardHelper
public static class ClipboardHelper : object

Remarks

The MIT License (MIT) Copyright (c) 2014 Arthur Teplitzki. https://gist.github.com/ArthurHub/10729205

Class Members

MemberDescription

EndFragment

html comment to point the end of html fragment

StartFragment

html comment to point the beginning of html fragment

ContainsImage

Safe way to retrieve whether clipboard contains an image

public static bool ContainsImage()

ContainsText

Safe way to retrieve whether clipboard contains an image

public static bool ContainsText()

CopyHtmlToClipboard

Clears clipboard and sets the given HTML and plain text fragment to the clipboard, providing additional meta-information for HTML.
See MarkdownMonster.ClipboardHelper.CreateDataObject(System.String,System.String) for HTML fragment details.

public static bool CopyHtmlToClipboard(string html,     string plainText,     bool showStatusError)

CreateDataObject

Create System.Windows.DataObject with given html and plain-text ready to be used for clipboard or drag and drop.
Handle missing ]]> tags, specified startend segments and Unicode characters.

public static DataObject CreateDataObject(string html,     string plainText)

GetHtmlFromClipboard

Returns the raw HTML of HTML content on the clipboard. Unlike GetText() this method returns the rendered HTML rather than the innerText of the HTML content.

public static string GetHtmlFromClipboard()

GetImage

Returns an image from the clipboard and capture exception

TODO: Deal with Image Transparency more reliably (DIB) https://stackoverflow.com/questions/30727343/fast-converting-bitmap-to-bitmapsource-wpf

public static Bitmap GetImage()

GetImageSource

Returns an image source from the clipboard if available

public static ImageSource GetImageSource()

GetText

Retrieves text from the clipboard and retries

public static string GetText()

SetText

Safely sets the clipboard and optionally displays a status error message

public static bool SetText(string text,     bool showStatusError)

Requirements

Namespace: MarkdownMonster
Assembly: markdownmonster.exe

See also:

MarkdownMonster.ClipboardHelper.CreateDataObject(System.String,System.String)

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