Table of Contents

Class WpfAdapter

Namespace
TheArtOfDev.HtmlRenderer.WPF.Adapters
Assembly
StockSharp.Xaml.dll

Adapter for WPF platform.

public class WpfAdapter : RAdapter
Inheritance
WpfAdapter
Inherited Members
Extension Methods

Properties

Instance

Singleton instance of global adapter.

public static WpfAdapter Instance { get; }

Property Value

WpfAdapter

Methods

ConvertImageInt(ImageSource)

Create image from the image source.

protected override RImage ConvertImageInt(ImageSource image)

Parameters

image ImageSource

Returns

RImage

CreateContextMenuInt()

Creates a new context menu instance.

protected override RContextMenu CreateContextMenuInt()

Returns

RContextMenu

CreateFontInt(string, double, RFontStyle)

Creates a new font instance with the specified properties.

protected override RFont CreateFontInt(string family, double size, RFontStyle style)

Parameters

family string

The font family name.

size double

The size of the font.

style RFontStyle

The font style, defined by the RFontStyle enum.

Returns

RFont

A new RFont object configured with the specified properties.

CreateFontInt(RFontFamily, double, RFontStyle)

Creates a new font instance with the specified properties.

protected override RFont CreateFontInt(RFontFamily family, double size, RFontStyle style)

Parameters

family RFontFamily

The font family name.

size double

The size of the font.

style RFontStyle

The font style, defined by the RFontStyle enum.

Returns

RFont

A new RFont object configured with the specified properties.

CreateLinearGradientBrush(RRect, RColor, RColor, double)

Create linear gradient brush for the given rectangle, color and angel.

protected override RBrush CreateLinearGradientBrush(RRect rect, RColor color1, RColor color2, double angle)

Parameters

rect RRect
color1 RColor
color2 RColor
angle double

Returns

RBrush

CreatePen(RColor)

Create a new pen with the specified color.

protected override RPen CreatePen(RColor color)

Parameters

color RColor

Returns

RPen

CreateSolidBrush(RColor)

Create solid brush for the given color.

protected override RBrush CreateSolidBrush(RColor color)

Parameters

color RColor

Returns

RBrush

GetClipboardDataObjectInt(string, string)

Measure the width of the string under the maximum width restriction, calculating the number of characters that can fit and the width those characters take.

protected override object GetClipboardDataObjectInt(string html, string plainText)

Parameters

html string
plainText string

Returns

object

GetColorInt(string)

Get color from the given color name.

protected override RColor GetColorInt(string colorName)

Parameters

colorName string

Returns

RColor

ImageFromStreamInt(string, byte[])

Create image from the image bytes.

protected override RImage ImageFromStreamInt(string extension, byte[] body)

Parameters

extension string
body byte[]

Returns

RImage

SaveToFileInt(RImage, string, string, RControl)

Saves the image to the specified file.

protected override void SaveToFileInt(RImage image, string name, string extension, RControl control = null)

Parameters

image RImage
name string
extension string
control RControl

SetToClipboardInt(string)

Sets the text to the clipboard.

protected override void SetToClipboardInt(string text)

Parameters

text string

SetToClipboardInt(string, string)

Sets the HTML and plain text to the clipboard.

protected override void SetToClipboardInt(string html, string plainText)

Parameters

html string
plainText string

SetToClipboardInt(RImage)

Sets the image to the clipboard.

protected override void SetToClipboardInt(RImage image)

Parameters

image RImage

Events

CreateContextMenuHandler

Context menu creation handler.

public event Func<RContextMenu> CreateContextMenuHandler

Event Type

Func<RContextMenu>

SaveToFileHandler

Save to file handler.

public event Action<RImage, string, string, RControl> SaveToFileHandler

Event Type

Action<RImage, string, string, RControl>