title: Writing a method that reports progress
body: <p>I'm writing a class that performs a certain operation in a library. But the operation is tedious, and I want to be able to find out the progress of the method inside that class so that I can use it in a WinForms application to report the progress.</p>
  
  <p>I'm planning to run my class on another thread in my WinForms application and I want the class to be separated from the concerns of the WinForms application, and I don't want to bind it to anything specific other than what it does.</p>
  
  <p>What would be the best way to implement a progress reporting mechanism in a library class?</p>
  
  <p>Would it be a good idea to somehow have a progress variable in the class, and add an event listener to it in my WinForms application? And if it is, how can I do it?</p>
  
  <p><strong>Edit:</strong> I have used the <code>BackgroundWorker</code> class before, but my problem is I don't want my library class to be concerned with any of the multithreading operations. So I don't want to invoke <code>ReportProgress</code> in the library class, I want to (maybe) have a variable in the class that contains the current progress and I want the UI thread to somehow "subscribe" to it. I don't know if that's a good way to design it though.</p>