Gorgon
Show / Hide Table of Contents

Class ClipboardService

The clipboard service used to assign or retrieve data from the internal clipboard.

Inheritance
object
ClipboardService
Implements
IClipboardService
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Editor.Services
Assembly: Gorgon.Editor.API.dll
Syntax
public class ClipboardService : IClipboardService

Properties

| Edit this page View Source

HasData

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 Source

Clear()

Function to clear the clipboard contents.

Declaration
public void Clear()
| Edit this page View Source

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.

| Edit this page View Source

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 T on the clipboard.

| Edit this page View Source

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.

Implements

IClipboardService

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