private void configureEventsFor(ColumnMappingControl cmc) { cmc.OnMappingCompleted += onColumnMappingMappingCompleted; cmc.OnMissingMapping += onColumnMappingMissingMapping; cmc.OnMappingCompleted -= setImportFlagToTrue; cmc.OnMissingMapping -= setImportFlagToFalse; }
private ColumnMappingControl createNewColumnMappingControl(DataSet preview, string sheet) { var cmc = new ColumnMappingControl(preview.Tables[sheet], _importDataTable, _imageListRetriever, _importerTask, _columnCaptionHelper) { Dock = DockStyle.Fill }; cmc.OnMappingCompleted += setImportFlagToTrue; cmc.OnMissingMapping += setImportFlagToFalse; _columnMappingControls.Add(sheet, cmc); return(cmc); }
private ColumnMappingControl createColumnMappingControl(DataTable sourceTable) { var columnMappingControl = new ColumnMappingControl(sourceTable, _importDataTable, _imageListRetriever, _importerTask, _columnCaptionHelper) { Dock = DockStyle.Fill }; _columnMappingControls.Add(sourceTable.TableName, columnMappingControl); columnMappingControl.OnMappingCompleted += onColumnMappingMappingCompleted; columnMappingControl.OnMissingMapping += onColumnMappingMissingMapping; return(columnMappingControl); }
private void cleanMemory() { _namingView = null; if (_openSourceFileControl != null) { _openSourceFileControl.OnOpenSourceFile -= openSourceFileEvent; _openSourceFileControl = null; } if (_imports != null) { foreach (ImportDataTable table in _imports.Tables) { table.MetaData?.Dispose(); table.Dispose(); } _imports.Dispose(); } if (_importDataTable != null) { _importDataTable.MetaData?.Dispose(); _importDataTable.Dispose(); } CleanUpHelper.ReleaseEvents(_dataSetControl); _dataSetControl?.Dispose(); CleanUpHelper.ReleaseEvents(_sourceFilePreviewControl); _sourceFilePreviewControl?.Dispose(); CleanUpHelper.ReleaseControls(Controls); Controls.Clear(); _imports = null; _openSourceFileControl = null; _sourceFilePreviewControl = null; _columnMappingControl = null; _dataSetControl = null; _importDataTable = null; _importer = null; _presenter = null; _dataRepositoryMapper = null; _importMapper = null; _columnInfos = null; cleanColumnMappingControls(); _columnMappingControls?.Clear(); _columnMappingControls = null; columnMappingControlPanel.Controls.Clear(); }
/// <summary> /// Method for creating a new column mapping control for selected sheet. /// </summary> /// <param name="sourceTable">Data table of a sheet of the source excel file.</param> private void layoutColumnMappingControl(DataTable sourceTable) { layoutControlSourceTab.BeginUpdate(); columnMappingControlPanel.BeginInit(); try { if (!_columnMappingControls.TryGetValue(sourceTable.TableName, out _columnMappingControl)) { _columnMappingControl = createColumnMappingControl(sourceTable); } _columnMappingControl.ValidateMapping(); columnMappingControlPanel.Controls.Clear(); columnMappingControlPanel.Controls.Add(_columnMappingControl); } finally { columnMappingControlPanel.EndInit(); layoutControlSourceTab.EndUpdate(); } }