hydrologics/Oasis.Base — Issue #10: Objects that the data/run finders can search for should implement ISearchResult
Author: slebherz
Created: 2011-10-18 20:52:37+00:00
State: open

The results of data/run finder queries are loaded into a results grid so that the user may look at them and decide whether to take further action. Some necessary data must be loaded into a results class that the datagrid knows how to display. The results class for the Find Data Window is the FoundDataResult. The [FoundDataResult's constructor] (https://github.com/hydrologics/Oasis.Presentation/blob/75425ae20d1aa82065dbe3f659ec70d9ce4676eb/ViewModels/FindWindow/FoundDataResult.cs#L63) should take an object that implements [ISearchResult] (https://github.com/hydrologics/Oasis.Presentation/blob/75425ae20d1aa82065dbe3f659ec70d9ce4676eb/ViewModels/FindWindow/Interfaces/ISearchResult.cs). It will then call its [base class constructor] (https://github.com/hydrologics/Oasis.Presentation/blob/75425ae20d1aa82065dbe3f659ec70d9ce4676eb/ViewModels/FindWindow/SearchResult.cs#L16) to fill in all generic properties that a datagrid should show by default.

Complication: not all run elements are going to have all of the properties. I see two options:
1. Trim the interface down to the "least common denominator" properties. In order to provide all the properties for the datagrid it seems that the FoundDataResult or SearchResult constructor will need to use reflection/switch-on-type to determine whether the run element has a Name (and if not provide a default value).
2. ISearchResult contains all possible properties and default values are provided whenever the run/run element does not contain certain properties.

To wrap up: Anything that the data finders can find (runs or run elements) must implement ISearchResult.