Class ClipboardService
The clipboard service used to assign or retrieve data from the internal clipboard.
Implements
Inherited Members
Namespace: Gorgon.Editor.Services
Assembly: Gorgon.Editor.API.dll
Syntax
public class ClipboardService : IClipboardService
Properties
| Edit this page View SourceHasData
Property to return whether or not there is data on the clipboard.
Declaration
public bool HasData { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceClear()
Function to clear the clipboard contents.
Declaration
public void Clear()
CopyItem(object)
Function to place an item on the clipboard for copying.
Declaration
public 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
public T GetData<T>()
Returns
Type | Description |
---|---|
T | The data as the specified type. |
Type Parameters
Name | Description |
---|---|
T | The type of data to retrieve. |
Remarks
If there is no data of the specified type on the clipboard, then this method will throw an exception. Check for data of the specified type using the IsType<T>() method prior to calling this method.
Exceptions
Type | Condition |
---|---|
GorgonException | Thrown if there is no data, or no data of type |
IsType<T>()
Function to return whether or not the data on the clipboard is of the type specified.
Declaration
public 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 will always return false.