Esempio n. 1
0
        private async void StartSearch()
        {
            try
            {
                ParentForm.Waiting();

                var searchString   = SearchStringTextBox.Text.Trim();
                var selectedTables = GetSelectedTables();

                if (string.IsNullOrEmpty(searchString) || selectedTables.Count < 1)
                {
                    return;
                }

                advancedSearch = new AdvancedSearch(searchString, selectedTables);

                List <DataTable> tables = await Task.Run(() =>
                {
                    return(advancedSearch.GetResults());
                });

                var displayGrid = new GridForm(ParentForm, "Advanced Search Results");
                foreach (var table in tables)
                {
                    displayGrid.AddGrid(table.TableName, table.TableName, table);
                }
                displayGrid.Show();
            }
            catch (Exception ex)
            {
                ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod());
            }
            finally
            {
                ParentForm.DoneWaiting();
            }
        }