Exemple #1
0
 protected override void ReadEntryPoint(EntryPoint ep)
 {
     _options          = new CSVImporterOptions();
     _options.Filename = ep["Filename"];
     _options.FirstRowContainsNames = Boolean.Parse(ep["FirstRowHeaders", "true"]);
     _options.Delimiter             = HttpUtility.HtmlDecode(ep["Delimiter"]);
 }
Exemple #2
0
        public override bool GetOptions(System.Windows.Window parentWindow, ImportWizardContext context)
        {
            var frm = new CSVImportOptionsWindow(_options);

            frm.Owner = parentWindow;
            frm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            if (frm.ShowDialog().GetValueOrDefault(false))
            {
                _options = new CSVImporterOptions {
                    Filename = frm.Filename, Delimiter = frm.Delimiter, FirstRowContainsNames = frm.IsFirstRowContainNames, ColumnNames = frm.ColumnNames
                };
                return(true);
            }

            return(false);
        }
        public CSVImportOptionsWindow(CSVImporterOptions options)
        {
            InitializeComponent();

            cmbDelimiter.ItemsSource = _delimiterOptions;

            if (options != null) {
                txtFilename.Text = options.Filename;
                cmbDelimiter.SelectedItem = FindDelimiter(options.Delimiter);
                chkFirstRowNames.IsChecked = options.FirstRowContainsNames;
            } else {
                cmbDelimiter.SelectedItem = FindDelimiter(",");
                chkFirstRowNames.IsChecked = true;
            }

            this.Closed += new EventHandler(CSVImportOptionsWindow_Closed);
        }
        public CSVImportOptionsWindow(CSVImporterOptions options)
        {
            InitializeComponent();

            cmbDelimiter.ItemsSource = _delimiterOptions;

            if (options != null)
            {
                txtFilename.Text           = options.Filename;
                cmbDelimiter.SelectedItem  = FindDelimiter(options.Delimiter);
                chkFirstRowNames.IsChecked = options.FirstRowContainsNames;
            }
            else
            {
                cmbDelimiter.SelectedItem  = FindDelimiter(",");
                chkFirstRowNames.IsChecked = true;
            }

            this.Closed += new EventHandler(CSVImportOptionsWindow_Closed);
        }
Exemple #5
0
 protected override void ReadEntryPoint(EntryPoint ep)
 {
     _options = new CSVImporterOptions();
     _options.Filename = ep["Filename"];
     _options.FirstRowContainsNames = Boolean.Parse(ep["FirstRowHeaders", "true"]);
     _options.Delimiter = HttpUtility.HtmlDecode(ep["Delimiter"]);
 }
Exemple #6
0
        public override bool GetOptions(System.Windows.Window parentWindow, ImportWizardContext context)
        {
            var frm = new CSVImportOptionsWindow(_options);
            frm.Owner = parentWindow;
            frm.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            if (frm.ShowDialog().GetValueOrDefault(false)) {
                _options = new CSVImporterOptions { Filename = frm.Filename, Delimiter = frm.Delimiter, FirstRowContainsNames = frm.IsFirstRowContainNames, ColumnNames = frm.ColumnNames };
                return true;
            }

            return false;
        }