Class ClipboardBase
Shared abstract class to enforce rules from the implementation of the IClipboard interface.
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Terminal.Gui
Assembly: Terminal.Gui.dll
Syntax
public abstract class ClipboardBase : IClipboard
Properties
| Improve this Doc View SourceIsSupported
Returns true if the environmental dependencies are in place to interact with the OS clipboard
Declaration
public abstract bool IsSupported { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceGetClipboardData()
Returns the contents of the OS clipboard if possible.
Declaration
public string GetClipboardData()
Returns
Type | Description |
---|---|
System.String | The contents of the OS clipboard if successful. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown if it was not possible to copy from the OS clipboard. |
GetClipboardDataImpl()
Returns the contents of the OS clipboard if possible. Implemented by ConsoleDriver-specific subclasses.
Declaration
protected abstract string GetClipboardDataImpl()
Returns
Type | Description |
---|---|
System.String | The contents of the OS clipboard if successful. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown if it was not possible to copy from the OS clipboard. |
SetClipboardData(String)
Pastes the
text
to the OS clipboard if possible.
Declaration
public void SetClipboardData(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text to paste to the OS clipboard. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown if it was not possible to paste to the OS clipboard. |
SetClipboardDataImpl(String)
Pastes the
text
to the OS clipboard if possible. Implemented by ConsoleDriver-specific subclasses.
Declaration
protected abstract void SetClipboardDataImpl(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text to paste to the OS clipboard. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown if it was not possible to paste to the OS clipboard. |
TryGetClipboardData(out String)
Copies the contents of the OS clipboard to
result
if possible.
Declaration
public bool TryGetClipboardData(out string result)
Parameters
Type | Name | Description |
---|---|---|
System.String | result | The contents of the OS clipboard if successful, System.String.Empty if not. |
Returns
Type | Description |
---|---|
System.Boolean | true the OS clipboard was retrieved, false otherwise. |
TrySetClipboardData(String)
Pastes the
text
to the OS clipboard if possible.
Declaration
public bool TrySetClipboardData(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text to paste to the OS clipboard. |
Returns
Type | Description |
---|---|
System.Boolean | true the OS clipboard was set, false otherwise. |