Table of Contents

Class DataObject

Namespace
RDCore.Forms.Model
Assembly
RDCore.Forms.dll

The data a drag carries, or a cut, copy or paste: RDForms.DataObject, the Data of a BeforeDragOver and a BeforeDropOrPaste. It holds text in formats: the text format, and custom formats a program names.

public sealed class DataObject
Inheritance
DataObject
Inherited Members

Remarks

RDForms does not implement drag and drop, so no event gives a program one; a program can make one with New. Its clipboard methods (PutInClipboard, GetFromClipboard) and StartDrag are not implemented.

Properties

Formats

The formats the object holds text in, the text format first where it holds one: null stands for the text format, and a string for a custom format of that name.

public IReadOnlyList<string?> Formats { get; }

Property Value

IReadOnlyList<string>

Methods

Clear()

Takes out the text of every format.

public void Clear()

GetFormat(string?)

Whether the object holds text in a format.

public bool GetFormat(string? format = null)

Parameters

format string

The name of a custom format, or null for the text format.

Returns

bool

true where it holds text in that format.

Exceptions

ArgumentException

format is empty.

GetText(string?)

The text the object holds in a format.

public string? GetText(string? format = null)

Parameters

format string

The name of a custom format, or null for the text format.

Returns

string

The text, or null where the object holds none in that format.

Exceptions

ArgumentException

format is empty.

SetText(string, string?)

Puts text in the object in a format, in place of the text it held in that format.

public void SetText(string text, string? format = null)

Parameters

text string

The text.

format string

The name of a custom format, or null for the text format.

Exceptions

ArgumentNullException

text is null.

ArgumentException

format is empty.