예제 #1
0
        private List <TableSchema> OnSqlTableRecordSelectionHandler(List <TableSchema> schema)
        {
            var     config = this._manager.CurrentConfiguration;
            Boolean hasExcludedTableRecords = (config.ExcludedTableRecords.Count > 0);

            if (hasExcludedTableRecords)
            {
                return(schema.Where(tableSchema => !config.ExcludedTableDefinitions.Contains(tableSchema.TableName)).ToList());
            }

            var updated = new List <TableSchema>();

            Invoke(new MethodInvoker(() =>
            {
                // Allow the user to select which tables to include by showing him the table selection dialog.
                var dlg          = new TableSelectionDialog("Select Table Data To Include");
                DialogResult res = dlg.ShowTables(schema, this);
                if (res == DialogResult.OK)
                {
                    updated = dlg.IncludedTables;
                }
            }));

            List <String> selectedTables = updated.Select(obj => obj.TableName).ToList();
            var           excludedTables = schema.Select(obj => obj.TableName).Except(selectedTables).ToList();

            config.ExcludedTableRecords = excludedTables;
            return(updated);
        }
예제 #2
0
        private List<TableSchema> OnSqlTableRecordSelectionHandler(List<TableSchema> schema)
        {
            var config = this._manager.CurrentConfiguration;
            Boolean hasExcludedTableRecords = (config.ExcludedTableRecords.Count > 0);

            if (hasExcludedTableRecords)
            {
                return schema.Where(tableSchema => !config.ExcludedTableDefinitions.Contains(tableSchema.TableName)).ToList();
            }

            var updated = new List<TableSchema>();
            Invoke(new MethodInvoker(() =>
            {
                // Allow the user to select which tables to include by showing him the table selection dialog.
                var dlg = new TableSelectionDialog("Select Table Data To Include");
                DialogResult res = dlg.ShowTables(schema, this);
                if (res == DialogResult.OK)
                {
                    updated = dlg.IncludedTables;
                }
            }));

            List<String> selectedTables = updated.Select(obj => obj.TableName).ToList();
            var excludedTables = schema.Select(obj => obj.TableName).Except(selectedTables).ToList();
            config.ExcludedTableRecords = excludedTables;
            return updated;
        }