public void SearchByDetail(SearchDetail <T> detail) { m_searchDetail = detail; m_searchForm = new SearchForm { WindowState = detail.WindowState, MdiParent = detail.MdiParent, SearchObjectType = typeof(T), StoredProc = detail.StoredProcedure, Text = detail.SearchText }; m_searchForm.OpenRow += LoadDetailView; if (detail.SearchButtons != null) { detail.SearchButtons.LoadButtons(m_searchForm); } if (m_searchDetail.ShowModal) { m_searchForm.ShowDialog(); } else { m_searchForm.Show(); } m_searchForm.Focus(); }
public void SearchByType() { SearchDetail <T> details = SearchSettings.GetSearchDetailsFor <T>(); if (details == null) { throw new NullReferenceException("Could not find SearchSettings for type " + typeof(T)); } SearchByDetail(details); }