public ColumnPicker(TableMappingViewModel tableMappingViewModel) { InitializeComponent(); DataContext = this; this.viewModel = tableMappingViewModel; items = tableMappingViewModel.TableMapping.ColumnMappings.Select(c => new ColumnPickerItem(c)).ToArray(); Closed += ColumnPicker_Closed; }
public static ColumnMappingViewModel CreateFromColumnMapping(ColumnMapping columnMapping, TableMappingViewModel tableMappingViewModel) { string type = columnMapping.GetType().ToString(); if (type == typeof(ExcelColumnMapping).ToString()) { return(new ExcelColumnMappingViewModel((ExcelColumnMapping)columnMapping, tableMappingViewModel)); } else if (type == typeof(TableColumnMapping).ToString()) { return(new TableColumnMappingViewModel((TableColumnMapping)columnMapping, tableMappingViewModel)); } else if (type == typeof(LiteralColumnMapping).ToString()) { return(new LiteralColumnMappingViewModel((LiteralColumnMapping)columnMapping, tableMappingViewModel)); } else { return(new NullColumnMappingViewModel((NullColumnMapping)columnMapping, tableMappingViewModel)); } }
public void RemoveMappingTable(TableMappingViewModel mappingTable) { tableMappingViewModels.Remove(mappingTable); NotifyPropertyChanged("TableMappings"); NotifyPropertyChanged("MappingTableReferences"); }
void TableMappingControl_Loaded(object sender, RoutedEventArgs e) { tableMappingViewModel = (TableMappingViewModel)DataContext; mappingPageViewModel = ((WizardViewModel)Window.GetWindow(this).DataContext).MappingPageViewModel; }
public NullColumnMappingViewModel(NullColumnMapping nullColumnMapping, TableMappingViewModel tableMappingViewModel) : base(nullColumnMapping, tableMappingViewModel) { this.importType = ColumnMappingImportType.Null; }
public ColumnMappingViewModel(ColumnMapping columnMapping, TableMappingViewModel tableMappingViewModel) { this.tableMappingViewModel = tableMappingViewModel; this.columnMapping = columnMapping; }
public static ColumnMappingViewModel CreateBlankSourceViewModel(ColumnMappingImportType importType, TableMappingViewModel tableMappingViewModel, DBColumn destinationColumn, ColumnUse columnUse) { switch (importType) { case (SQLImporter.ViewModel.ColumnMappingImportType.Excel): ExcelColumnMapping excelColumnMapping = new ExcelColumnMapping("", destinationColumn, columnUse); return(new ExcelColumnMappingViewModel(excelColumnMapping, tableMappingViewModel)); case (SQLImporter.ViewModel.ColumnMappingImportType.Table): TableColumnMapping tableColumnMapping = new TableColumnMapping(null, null, destinationColumn, columnUse); return(new TableColumnMappingViewModel(tableColumnMapping, tableMappingViewModel)); case (SQLImporter.ViewModel.ColumnMappingImportType.Literal): LiteralColumnMapping literalColumnMapping = new LiteralColumnMapping("", LiteralType.String, destinationColumn, columnUse); return(new LiteralColumnMappingViewModel(literalColumnMapping, tableMappingViewModel)); default: NullColumnMapping nullColumnMapping = new NullColumnMapping(destinationColumn, columnUse); return(new NullColumnMappingViewModel(nullColumnMapping, tableMappingViewModel)); } }
public LiteralColumnMappingViewModel(LiteralColumnMapping literalColumnMapping, TableMappingViewModel tableMappingViewModel) : base(literalColumnMapping, tableMappingViewModel) { this.importType = ColumnMappingImportType.Literal; }
public TableColumnMappingViewModel(TableColumnMapping tableColumnMapping, TableMappingViewModel tableMappingViewModel) : base(tableColumnMapping, tableMappingViewModel) { this.importType = ColumnMappingImportType.Table; }
public ExcelColumnMappingViewModel(ExcelColumnMapping excelColumnMapping, TableMappingViewModel tableMappingViewModel) : base(excelColumnMapping, tableMappingViewModel) { this.importType = ColumnMappingImportType.Excel; }