コード例 #1
0
        public ColumnPicker(TableMappingViewModel tableMappingViewModel)
        {
            InitializeComponent();
            DataContext = this;

            this.viewModel = tableMappingViewModel;

            items = tableMappingViewModel.TableMapping.ColumnMappings.Select(c => new ColumnPickerItem(c)).ToArray();

            Closed += ColumnPicker_Closed;
        }
コード例 #2
0
        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));
            }
        }
コード例 #3
0
 public void RemoveMappingTable(TableMappingViewModel mappingTable)
 {
     tableMappingViewModels.Remove(mappingTable);
     NotifyPropertyChanged("TableMappings");
     NotifyPropertyChanged("MappingTableReferences");
 }
コード例 #4
0
 void TableMappingControl_Loaded(object sender, RoutedEventArgs e)
 {
     tableMappingViewModel = (TableMappingViewModel)DataContext;
     mappingPageViewModel = ((WizardViewModel)Window.GetWindow(this).DataContext).MappingPageViewModel;
 }
コード例 #5
0
 public void RemoveMappingTable(TableMappingViewModel mappingTable)
 {
     tableMappingViewModels.Remove(mappingTable);
     NotifyPropertyChanged("TableMappings");
     NotifyPropertyChanged("MappingTableReferences");
 }
コード例 #6
0
 public NullColumnMappingViewModel(NullColumnMapping nullColumnMapping, TableMappingViewModel tableMappingViewModel) :
     base(nullColumnMapping, tableMappingViewModel)
 {
     this.importType = ColumnMappingImportType.Null;
 }
コード例 #7
0
 public ColumnMappingViewModel(ColumnMapping columnMapping,
                               TableMappingViewModel tableMappingViewModel)
 {
     this.tableMappingViewModel = tableMappingViewModel;
     this.columnMapping         = columnMapping;
 }
コード例 #8
0
        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));
            }
        }
コード例 #9
0
 public LiteralColumnMappingViewModel(LiteralColumnMapping literalColumnMapping,
                                      TableMappingViewModel tableMappingViewModel)
     : base(literalColumnMapping, tableMappingViewModel)
 {
     this.importType = ColumnMappingImportType.Literal;
 }
コード例 #10
0
 public TableColumnMappingViewModel(TableColumnMapping tableColumnMapping,
                                    TableMappingViewModel tableMappingViewModel)
     : base(tableColumnMapping, tableMappingViewModel)
 {
     this.importType = ColumnMappingImportType.Table;
 }
コード例 #11
0
 public ExcelColumnMappingViewModel(ExcelColumnMapping excelColumnMapping, TableMappingViewModel tableMappingViewModel) :
     base(excelColumnMapping, tableMappingViewModel)
 {
     this.importType = ColumnMappingImportType.Excel;
 }