Skip to content →

Generic processing of a Drag event from the file system

This is an extension method to help a user in processing a DragEventArgs to a object type of their choice.

How

  • Take a function to create the required Type from a FileStream.
  • Take an Action to handle an exception.
  • Check that the drop array contains a FileDrop.
  • Select the First FileInfo and open a FileStream.
  • Execute createAction with this FileStream. If this fails the exception will be handled by the onFailed callback.

The Code:

Published in Development

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.