I have a Windows application written in C #. the main_form class creates an AccessProcess instance called AccessProcessWorker, which is a class that inherits from BackgroundWorker, then main_form then initializes the Process with the following code
AccessProcessWorker.DoWork += new DoWorkEventHandler(processWorker.worker_DoWork);
AccessProcessWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(processWorkerCompleted);
AccessProcessWorker.ProgressChanged += new ProgressChangedEventHandler(processProgressChanged);
this application has just left POC to "get it working fast."
I wrote this application for working with Access database, but now I want this to happen against MS Sql, but also leave the opportunity to work with access. That way, I could do something ugly, like instantiate and initialize SqlProcessWorker or AccessProcessWorker based on some user interface choice made by the user. But I would like to make main_form always create something like IProcess, so I didnβt have to add logic to main_form every time a new ProcessWorker appears. The problem in my design is that initialization breaks when I do it the way I described.
If anyone has any ideas or needs further clairification, please let me know.