Closed iluvadev closed 3 years ago
Very nice. I agree that this is a good thing to do. I'm going to pull it into a branch called Divided and take a closer look at what you have done. Thanks!
This is only a first attempt to have the engine process in a project. Needs a code review to ensure that all responsibilities are well separated
It's a good start, though. The only thing I disagreed with so far was changes to eliminate unreferenced exception variables by making it a simple catch, which will change the exception semantics. I will re-change these to simply remove the variable.
You are right about the code review. For instance, I think Message needs to be factored into Message in the core, and MessageView in the UI.
You're right I've changed the semantics in the exception catching, sorry. I removed it trying to reduce Warnings.
I think the ReadMessages function needs refactoring too, it is called from the UI to get the messages in a folder. Then the UI thread adds these messages inside this folder. I think this could be just one operation: ReadMessages (folder), and then "folder" has all the Messages ... or better: folder.ReadMessages () or folder.GetMessages () ... But it's dangerous: what happens in the UI, and the bindings?
Tomorrow I'll test it
In the version currently in the Divided branch of the repository, I have restored the exception semantics and removed all warning messages.
I have started blundering around with a MessageView, which is what the UI would bind to. I am keeping file export and decryption in the core, so that they will be available to a command line version, and just focusing on factoring all the UI state into MessageView. Core ReadMessages would return Messages, and for the UI, something would wrap each one in a MessageView. I will find out in the next few days whether this approach comes out at all nicely.
OK, perfect, good luck. Let me know if I can help you
I have pushed the results of my refactoring to the Divided branch. I would much appreciate any code review you can do, particularly in finding any more UI support holdouts in core. And, of course, any testing you can do would also be very welcome. The changes are far-reaching enough to have broken almost anything.
Wow, Nice! I have synchronized the code. In a while I try to review it, and make some tests. I keep you informed. 👍
I have divided the solution into 2 different projects:
In this way, the engine can be used from other .NET projects
I wanted the Core project to use .Net Standard (to be able to convert it to cross-platform), but I had issues with the RTF process (uses FlowDocument). To avoid losing functionality and having to redo the RTF treatment, the Core project uses .Net Framework 4