c# - Need explanation why Clipboard.SetText("") is not equal to Clipboard.Clear() -


i passing article clipboard.settext() method microsoft: clipboard.settext method (string)

and realize if string empty(""), throw exception.

why that? why isn't equal clipboard.clear() instead?

i curious.

like many methods down implementation.

in case poorly implemented. wouldn't think throwing argumentnullexception when supplying value isn't null wise, stated in documentation link.

however, makes no sense store empty string in clipboard, presumably check put in block happening , make everyone's life easier.

assuming using standard windows api call clipboard, actual implementation causes different behaviour if supplied value null, in means value accessed when 'paste' or retrieve contents.

as clipboard can perform data conversions depending on type specified in clipboard, in theory there issues around having blank string interpreted null or vice versa.

this speculation, because there isn't detail on in documentation. you'd have test see happens. interesting information found in setclipboarddata function (msdn).


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -