midora Posted July 16, 2013 Share Posted July 16, 2013 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. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted July 16, 2013 Share Posted July 16, 2013 Why would you cancel it? The user told you to load it! 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 July 17, 2013 Author Share Posted July 17, 2013 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. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted July 17, 2013 Share Posted July 17, 2013 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. 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 July 18, 2013 Share Posted July 18, 2013 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. 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 July 19, 2013 Author Share Posted July 19, 2013 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. 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.