コード例 #1
0
        public TableMappingViewModel(DBTable table, MappingPageViewModel mappingPageViewModel)
        {
            this.viewModel = mappingPageViewModel;

            ColumnMapping[] mappings = new ColumnMapping[table.Columns.Count];
            ObservableCollection<ColumnMappingViewModel> viewModels = new ObservableCollection<ColumnMappingViewModel>();

            for (int i = 0; i < table.Columns.Count; i++)
            {
                mappings[i] = new NullColumnMapping(table.Columns[i], ColumnUse.Insert);
                viewModels.Add(new NullColumnMappingViewModel((NullColumnMapping)mappings[i], this));
            }

            this.tableMapping = new TableMapping(table, TableMappingImportType.Insert, mappings);
            this.columnsMappingViewModels = viewModels.ToList();
        }
コード例 #2
0
        public TableMappingViewModel(DBTable table, MappingPageViewModel mappingPageViewModel)
        {
            this.viewModel = mappingPageViewModel;

            ColumnMapping[] mappings = new ColumnMapping[table.Columns.Count];
            ObservableCollection <ColumnMappingViewModel> viewModels = new ObservableCollection <ColumnMappingViewModel>();

            for (int i = 0; i < table.Columns.Count; i++)
            {
                mappings[i] = new NullColumnMapping(table.Columns[i], ColumnUse.Insert);
                viewModels.Add(new NullColumnMappingViewModel((NullColumnMapping)mappings[i], this));
            }

            this.tableMapping             = new TableMapping(table, TableMappingImportType.Insert, mappings);
            this.columnsMappingViewModels = viewModels.ToList();
        }
コード例 #3
0
        public TableMappingViewModel(TableMapping tableMapping, MappingPageViewModel mappingPageViewModel)
        {
            this.viewModel = mappingPageViewModel;

            ObservableCollection<ColumnMappingViewModel> viewModels = new ObservableCollection<ColumnMappingViewModel>();

            foreach (DBColumn column in tableMapping.DestinationTable.Columns)
            {
                ColumnMapping columnMapping = tableMapping.ColumnMappings.Where(c => c.DestinationColumn == column).FirstOrDefault();
                if (columnMapping == null) columnMapping = new NullColumnMapping(column, tableMapping.AllowedColumnUses()[0]);
                viewModels.Add(ColumnMappingViewModelCreator.CreateFromColumnMapping(columnMapping, this));
            }

            ColumnMapping[] columnMappings = viewModels.Select(v => v.ColumnMapping).ToArray();
            tableMapping.ColumnMappings = columnMappings;

            this.tableMapping = tableMapping;
            this.columnsMappingViewModels = viewModels.ToList();
        }
コード例 #4
0
        public TableMappingViewModel(TableMapping tableMapping, MappingPageViewModel mappingPageViewModel)
        {
            this.viewModel = mappingPageViewModel;

            ObservableCollection <ColumnMappingViewModel> viewModels = new ObservableCollection <ColumnMappingViewModel>();

            foreach (DBColumn column in tableMapping.DestinationTable.Columns)
            {
                ColumnMapping columnMapping = tableMapping.ColumnMappings.Where(c => c.DestinationColumn == column).FirstOrDefault();
                if (columnMapping == null)
                {
                    columnMapping = new NullColumnMapping(column, tableMapping.AllowedColumnUses()[0]);
                }
                viewModels.Add(ColumnMappingViewModelCreator.CreateFromColumnMapping(columnMapping, this));
            }

            ColumnMapping[] columnMappings = viewModels.Select(v => v.ColumnMapping).ToArray();
            tableMapping.ColumnMappings = columnMappings;

            this.tableMapping             = tableMapping;
            this.columnsMappingViewModels = viewModels.ToList();
        }
コード例 #5
0
 void TableMappingControl_Loaded(object sender, RoutedEventArgs e)
 {
     tableMappingViewModel = (TableMappingViewModel)DataContext;
     mappingPageViewModel = ((WizardViewModel)Window.GetWindow(this).DataContext).MappingPageViewModel;
 }
コード例 #6
0
 public WizardViewModel()
 {
     connectionPageViewModel = new ConnectionPageViewModel(this);
     mappingPageViewModel = new MappingPageViewModel(this);
     importPageViewModel = new ImportPageViewModel(this);
 }
コード例 #7
0
 public WizardViewModel()
 {
     connectionPageViewModel = new ConnectionPageViewModel(this);
     mappingPageViewModel    = new MappingPageViewModel(this);
     importPageViewModel     = new ImportPageViewModel(this);
 }