Class Clipboard

Definition

Namespace:
Tizen.NUI
Assembly:
Tizen.NUI.dll

Clipboard.

C#
Copy
public class Clipboard : BaseHandle, IDynamicResourceHandler, IElement, INameScope, IElementController, System.IDisposable
Inheritance
Implements

Properties

View Source

Instance

Gets the singleton instance of Clipboard.

Declaration
C#
Copy
public static Clipboard Instance { get; }
Property Value
Type Description
Clipboard

Methods

View Source

Dispose(DisposeTypes)

Dispose.

Declaration
C#
Copy
protected override void Dispose(DisposeTypes type)
Parameters
Type Name Description
DisposeTypes type
Overrides
View Source

GetData(String, Clipboard.ClipboardCallback)

Request get data of the specified mime type from clipboard
and invokes the given callback with the received clipboard data.

Declaration
C#
Copy
public void GetData(string mimeType, Clipboard.ClipboardCallback dataReceivedCallback)
Parameters
Type Name Description
String mimeType

The mime type of data to request.

Clipboard.ClipboardCallback dataReceivedCallback

The callback method to handle the received clipboard data.

Remarks

GetData() method is introduced to fetch data of the specified mime type,
and it expects a callback function as a parameter.
The given callback is invoked with received clipboard data.
The callback is designed to be used only once for handling the data.

Examples

The following example demonstrates how to use the GetData and ClipboardCallback.

Copy
string MIME_TYPE_PLAIN_TEXT = "text/plain;charset=utf-8"; Clipboard.Instance.GetData(MIME_TYPE_PLAIN_TEXT, OnClipboardDataReceived); ... public void OnClipboardDataReceived(bool success, ClipEvent clipEvent) { if (!success) return; string mimeType = clipEvent.MimeType; string data = clipEvent.Data; }
View Source

SetData(String, String)

Request set the given data to the clipboard.

Declaration
C#
Copy
public bool SetData(string mimeType, string data)
Parameters
Type Name Description
String mimeType

The mime type of the data.

String data

The data to be set on the clipboard.

Returns
Type Description
Boolean

True if the internal clipboard sending request is successful.

Examples

The following example demonstrates how to use the SetData.

Copy
string MIME_TYPE_PLAIN_TEXT = "text/plain;charset=utf-8"; Clipboard.Instance.SetData(MIME_TYPE_PLAIN_TEXT, "Hello Clipboard");

Events

View Source

DataSelected

The DataSelected event is emitted when a copy event occurs somewhere.
In order for this event to operate normally,
the process using this event must be Secondary Selection.

Declaration
C#
Copy
public event EventHandler<ClipboardDataSelectedEventArgs> DataSelected
Event Type
Type Description
EventHandler<ClipboardDataSelectedEventArgs>
Examples

The following example demonstrates how to use the DataSelected.

Copy
kvmService.SetSecondarySelection(); // precondition Clipboard.Instance.DataSelected += (s, e) => { string selectedType = e.MimeType; };

Implements

Extension Methods