public override List <string> GetColumnNames() { var service = new ImportStagingService(_options.Filename); var mappings = service.GetMappings(); service.Dispose(); _columnNames = new List <string>(mappings.Select((mapping) => { return(mapping.SourceColumn); })); return(_columnNames); }
public ErrorDatabaseImportOptionsWindow(ErrorDatabaseImporterOptions options, ImportWizardContext context) { InitializeComponent(); _service = new ImportStagingService(options.Filename); Options = options; Context = context; _mappings = _service.GetMappings(); dataGrid.AutoGenerateColumns = false; foreach (ImportFieldMapping mapping in _mappings) { dataGrid.Columns.Add(CreateColumn(mapping)); } var ds = _service.GetErrorsDataSet(); dataGrid.ItemsSource = ds.Tables[0].DefaultView; dataGrid.IsReadOnly = true; dataGrid.MouseDoubleClick += new MouseButtonEventHandler(dataGrid_MouseDoubleClick); }