예제 #1
0
        public override bool GetOptions(System.Windows.Window parentWindow, ImportWizardContext context)
        {
            var filename = PromptForFilename("*.sqlite", "Error databases (*.sqlite)|*.sqlite");

            if (!string.IsNullOrEmpty(filename))
            {
                _options = new ErrorDatabaseImporterOptions {
                    Filename = filename
                };
                var frm = new ErrorDatabaseImportOptionsWindow(_options, context);
                frm.Owner = parentWindow;
                frm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                return(frm.ShowDialog().ValueOrFalse());
            }

            return(false);
        }
        public ErrorDatabaseImportOptionsWindow(ErrorDatabaseImporterOptions options, ImportWizardContext context)
        {
            InitializeComponent();
            _service = new ImportStagingService(options.Filename);
            Options = options;
            Context = context;

            _mappings = _service.GetMappings();

            dataGrid.AutoGenerateColumns = false;

            foreach (ImportFieldMapping mapping in _mappings) {
                dataGrid.Columns.Add(CreateColumn(mapping));
            }

            var ds = _service.GetErrorsDataSet();
            dataGrid.ItemsSource = ds.Tables[0].DefaultView;
            dataGrid.IsReadOnly = true;
            dataGrid.MouseDoubleClick += new MouseButtonEventHandler(dataGrid_MouseDoubleClick);
        }
        public ErrorDatabaseImportOptionsWindow(ErrorDatabaseImporterOptions options, ImportWizardContext context)
        {
            InitializeComponent();
            _service = new ImportStagingService(options.Filename);
            Options  = options;
            Context  = context;

            _mappings = _service.GetMappings();

            dataGrid.AutoGenerateColumns = false;

            foreach (ImportFieldMapping mapping in _mappings)
            {
                dataGrid.Columns.Add(CreateColumn(mapping));
            }

            var ds = _service.GetErrorsDataSet();

            dataGrid.ItemsSource       = ds.Tables[0].DefaultView;
            dataGrid.IsReadOnly        = true;
            dataGrid.MouseDoubleClick += new MouseButtonEventHandler(dataGrid_MouseDoubleClick);
        }
예제 #4
0
 protected override void ReadEntryPoint(Utilities.EntryPoint ep)
 {
     _options = new ErrorDatabaseImporterOptions {
         Filename = ep["Filename"]
     };
 }
예제 #5
0
        public override bool GetOptions(System.Windows.Window parentWindow, ImportWizardContext context)
        {
            var filename = PromptForFilename("*.sqlite", "Error databases (*.sqlite)|*.sqlite");
            if (!string.IsNullOrEmpty(filename)) {
                _options = new ErrorDatabaseImporterOptions { Filename = filename };
                var frm = new ErrorDatabaseImportOptionsWindow(_options, context);
                frm.Owner = parentWindow;
                frm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                return frm.ShowDialog().ValueOrFalse();
            }

            return false;
        }
예제 #6
0
 protected override void ReadEntryPoint(Utilities.EntryPoint ep)
 {
     _options = new ErrorDatabaseImporterOptions { Filename = ep["Filename"] };
 }