Exemplo n.º 1
0
        public FinderForm <T> CreateForm(IList <T> list,
                                         IList <ColumnDescriptor> columnDescriptors,
                                         bool allowMultiSelection,
                                         string filterSettingsContext = null)
        {
            Assert.ArgumentNotNull(list, nameof(list));

            var form = new FinderForm <T>(GetColumnDescriptors(columnDescriptors),
                                          list, allowMultiSelection,
                                          filterSettingsContext: filterSettingsContext);

            new FinderPresenter <T>(form);

            return(form);
        }
Exemplo n.º 2
0
        public FinderForm <T> CreateForm(IEnumerable <FinderQuery <T> > finderQueries,
                                         IList <ColumnDescriptor> columnDescriptors,
                                         bool allowMultiSelection,
                                         string filterSettingsContext = null)
        {
            Assert.ArgumentNotNull(finderQueries, nameof(finderQueries));

            var form = new FinderForm <T>(GetColumnDescriptors(columnDescriptors),
                                          finderQueries, allowMultiSelection,
                                          filterSettingsContext: filterSettingsContext);

            new FinderPresenter <T>(form);

            return(form);
        }
Exemplo n.º 3
0
        public IList <T> ShowDialog(IWin32Window owner, IList <T> list,
                                    bool allowMultiSelection,
                                    IList <ColumnDescriptor> columnDescriptors,
                                    string filterSettingsContext = null)
        {
            Assert.ArgumentNotNull(owner, nameof(owner));
            Assert.ArgumentNotNull(list, nameof(list));

            FinderForm <T> form = CreateForm(list, columnDescriptors, allowMultiSelection,
                                             filterSettingsContext);

            DialogResult result = form.ShowDialog(owner);

            return(result == DialogResult.OK
                                       ? form.Selection
                                       : null);
        }