Jump to content

FileType plugins: IsCancelRequested


midora

Recommended Posts

I'm missing something like Effect.IsCancelRequested() in the FileTypes class. Or do I need new glasses? ;-)

 

If you are saving a large file it takes sometimes minutes to cancel the operation.

 

The same problem exists if the save and load methods are used to calculate the preview in the save dialog.

I'm not sure what happens exactly if you are editing a lot of options in the save dialog, but it looks like that each edit triggers a new save and load operation in the background and all operations are updating the percentage value in parallel because none of them can be canceled.

 

An IsCancelRequested() method would allow updated filetype plugins to speed up the canceling of the operation.

 

 

 

 

 

 

 

 

 

 

 

 

 

midoras signature.gif

Link to comment
Share on other sites

  • 7 years later...

I'm not so happy with the current solution that paint.net throws an OperationCancelException which the plugin can catch to cleanup the save operation (or the loading of the preview). It makes the design of the code more complex.

 

Plus my current issue that paint.net just dies and I have no idea if the issue is in the plugin code or not. And what will happen if I'm optimizing the code by using multiple tasks? Will the cleanup work?

midoras signature.gif

Link to comment
Share on other sites

There's no IsCancelRequested because there's currently no way pass in any additional context into the Save/Load methods. At some point I'll be refactoring to add this in, which will enable a bunch of other stuff as well.

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

5 minutes ago, midora said:

Plus my current issue that paint.net just dies and I have no idea if the issue is in the plugin code or not. And what will happen if I'm optimizing the code by using multiple tasks? Will the cleanup work?

 

I told you how to track down the crash log for the AV you're getting, make sure to try it out.

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

16 minutes ago, Rick Brewster said:

 

I told you how to track down the crash log for the AV you're getting, make sure to try it out.

 

I did this without getting a log as I mentioned in the related topic (or maybe I was not able to locate it)

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...