Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your Model will deal with your zip file in this case, e.g. methods like <code>Print()</code>, <code>Extract()</code> etc. and events like <code>PrintCompleted</code> and <code>ExtractCompleted</code> etc. </p> <p>Your IView will expose methods and events that abstract your interaction with the UI behind an interface. So perhaps some methods such as <code>DisplayFolderContents()</code> and events like <code>FileSelected()</code> etc. </p> <p>Your presenter will hook up to the Model and IView events and control which methods are called on each etc. The Form that you have a TabControl on is just an implemenation of the IView interface. You could have a different view just by injecting an implementation of IView into the Presenter, including a Mock IView for testing. </p> <p>Values can be passed around the MVP pattern through the EventArgs you use. </p> <pre><code>/// &lt;summary&gt; /// The event args for a selected file. /// &lt;/summary&gt; public class FileSelectedEventArgs : EventArgs { public string FileName { get; private set; } public FileSelectedEventArgs(string fileName) { this.FileName = fileName; } } </code></pre> <p>When the user selects a file, the <code>FileSelected</code> event is raised in your View, with the FileName available in the <code>FileSelectedEventArgs</code>. The Presenter listens for this event, and calls a method on the Model - maybe <code>ExtractFile(string fileName)</code>, passing in the fileName from the FileSelectedEventArgs from the View. </p> <p>The Presenter then listens to the <code>ExtractCompleted</code> event to be fired from the Model (which also has whatever custom eventargs you want) and calls the appropriate method on your View, passing in the parameters from the Model. The method in the View can do whatever you want in terms of displaying the data in a TabControl or in another way. </p> <p>This is just one way of doing it anyway. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload