public static void Run(Form owner, SearchOptions options, IEnumerable <Receipt> pool, object merchantSource, object receiptSource) { var dlg = new SearchResultsDialog(options, pool, merchantSource, receiptSource); dlg.Text = "Search Results"; dlg.StartPosition = FormStartPosition.Manual; dlg.Location = new Point(owner.Location.X + (owner.Width - dlg.Width) / 2, owner.Location.Y + (owner.Height - dlg.Height) / 2); dlg.Show(owner); }
private void tbbSearch_ItemClick(object sender, ItemClickEventArgs e) { var receipts = new BindingList <Receipt>(); receipts.ListChanged += receipts_ListChanged; var merchants = gridReceipts.MerchantSource; using (var dlg = new SearchOptionsDialog()) { dlg.Text = "Search..."; if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { SearchResultsDialog.Run(this, dlg.CreateOptions(), gridReceipts.Receipts, merchants, receipts); } } }