ispiro
ispiro

Reputation: 27713

Why does Clipboard.GetText() need the Clipboard to be clearable?

The documentation for Clipboard.GetText() states that it can raise an ExternalException if:

The Clipboard could not be cleared.

Why would GetText need the Clipboard to be clearable?

Upvotes: 1

Views: 188

Answers (1)

Broots Waymb
Broots Waymb

Reputation: 4826

To me, this seems like an oddity in the documentation. After tracing through the source, I can't think of a reason it needs to be clearable as it doesn't appear to attempt to try clearing it.

The second part ("This typically occurs when the Clipboard is being used by another process.") does appear accurate though.
Seems to me the part about text being clearable could have been copied from Clipboard.SetText or Clipboard.Clear, as they are word-for-word the same, but seems far more applicable (although I did not go deeply into the source on this one).

Upvotes: 2

Related Questions