Interface IClipboardService
An interface for accessing or storing data on the clipboard.
Namespace: Gorgon.Editor.Services
Assembly: Gorgon.Editor.API.dll
Syntax
public interface IClipboardService
Properties
| Edit this page View SourceHasData
Property to return whether or not there is data on the clipboard.
Declaration
bool HasData { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceClear()
Function to clear the clipboard contents.
Declaration
void Clear()
CopyItem(object)
Function to place an item on the clipboard for copying.
Declaration
void CopyItem(object item)
Parameters
Type | Name | Description |
---|---|---|
object | item | The item to copy. |
GetData<T>()
Function to return the data from the clipboard as the specified type.
Declaration
T GetData<T>()
Returns
Type | Description |
---|---|
T | The data as the specified type. |
Type Parameters
Name | Description |
---|---|
T | The type of data to return. |
Remarks
If there is no data of the specified type on the clipboard, then this method should throw an exception. Check for data of the specified type using the IsType<T>() method prior to calling this method.
IsType<T>()
Function to return whether or not the data on the clipboard is of the type specified.
Declaration
bool IsType<T>()
Returns
Type | Description |
---|---|
bool | true if the data is of the type specified, false if not. |
Type Parameters
Name | Description |
---|---|
T | The type to check. |
Remarks
If there is no data on the clipboard, then this should always return false.