Jump to content

FileType plugins: Cancel OnLoad


Recommended Posts

As far as I understand the issue, it is not forseen to cancel OnLoad().

 

Returning null or throwing an exception will result in the message box

 

"There was an unspecified error while opening the file."

 

So if there is no other solution I propose to check for OperationCanceledException in the future and skip the messagebox in this case.

 

I will add this to my FileType plugins.

 

BTW: Returning a document w/o any layer will kill Paint.NET, sooner or later.

 

 

 

 

 

midoras signature.gif

Link to comment
Share on other sites

There are several reasons. I.e:

- the user gets more information on the type of the file from the input stream and changes the decicision to load the file

- loading takes too long and the user likes to abort. (there is a reason why a running effect can be aborted)

 

If you like to keep the error for any reason then I would propose to show the reason if possible (and not unspecified which is not true). This would help the user to understand what's going on.

midoras signature.gif

Link to comment
Share on other sites

Cancelling a load operation isn't supported because showing UI for loading a file isn't supported. What you're doing is by definition a hack, so asking why it doesn't work very well is kind of silly.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Also, to add more information here, this is something that I've wanted to support (both cancellation and loader UIs). However, it's just never managed to reach the top of the priority list, especially because none of the built-in file types need it.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Cancelling a load operation isn't supported because showing UI for loading a file isn't supported. What you're doing is by definition a hack, so asking why it doesn't work very well is kind of silly.

 

Rick be fair ;-) , I never asked: why?

I just stated the situation and proposed something.

midoras signature.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...