midora Posted November 13, 2014 Share Posted November 13, 2014 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. Quote Link to comment Share on other sites More sharing options...
midora Posted November 30, 2021 Author Share Posted November 30, 2021 Bump 😉 Quote Link to comment Share on other sites More sharing options...
MJW Posted November 30, 2021 Share Posted November 30, 2021 I agree that would be a desirable feature. Having a program hang for a long time when trying to cancel an operation is very annoying. That was true seven years ago, and it's true today Quote Link to comment Share on other sites More sharing options...
midora Posted November 30, 2021 Author Share Posted November 30, 2021 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? Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted November 30, 2021 Share Posted November 30, 2021 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. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Rick Brewster Posted November 30, 2021 Share Posted November 30, 2021 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. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
midora Posted November 30, 2021 Author Share Posted November 30, 2021 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) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.