Gorgon
Show / Hide Table of Contents

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 Source

HasData

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 Source

Clear()

Function to clear the clipboard contents.

Declaration
void Clear()
| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author