Exemplo n.º 1
0
 public ImporterView(IColumnInfosToImportDataTableMapper importMapper, IImportDataTableToDataRepositoryMapper dataRepositoryMapper, IImageListRetriever imageListRetriever,
                     IDialogCreator dialogCreator, IImporterTask importerTask, IColumnCaptionHelper columnCaptionHelper)
 {
     _importMapper         = importMapper;
     _dataRepositoryMapper = dataRepositoryMapper;
     _imageListRetriever   = imageListRetriever;
     _dialogCreator        = dialogCreator;
     _importerTask         = importerTask;
     _columnCaptionHelper  = columnCaptionHelper;
     InitializeComponent();
 }
Exemplo n.º 2
0
        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();
        }