Beispiel #1
0
 public override ImportRowSource CreateRowSource(IProgressObserver progress)
 {
     if (_options != null) {
         if (_options.RowSource == null) {
             var builder = new BVPImportSourceBuilder(_options.Filename);
             _options.RowSource = builder.BuildRowSource();
         }
         return _options.RowSource;
     }
     return null;
 }
 public override ImportRowSource CreateRowSource(IProgressObserver progress)
 {
     if (_options != null)
     {
         if (_options.RowSource == null)
         {
             var builder = new BVPImportSourceBuilder(_options.Filename);
             _options.RowSource = builder.BuildRowSource();
         }
         return(_options.RowSource);
     }
     return(null);
 }
Beispiel #3
0
        public override List<string> GetColumnNames()
        {
            var columns = new List<String>();
            if (_options != null) {

                if (_options.RowSource == null) {
                    var builder = new BVPImportSourceBuilder(_options.Filename);
                    _options.RowSource = builder.BuildRowSource();
                }

                for (int i = 0; i < _options.RowSource.ColumnCount; i++) {
                    columns.Add(_options.RowSource.ColumnName(i));
                }
            }

            return columns;
        }
        public override List <string> GetColumnNames()
        {
            var columns = new List <String>();

            if (_options != null)
            {
                if (_options.RowSource == null)
                {
                    var builder = new BVPImportSourceBuilder(_options.Filename);
                    _options.RowSource = builder.BuildRowSource();
                }

                for (int i = 0; i < _options.RowSource.ColumnCount; i++)
                {
                    columns.Add(_options.RowSource.ColumnName(i));
                }
            }

            return(columns);
        }
Beispiel #5
0
        private void PreviewDataSet()
        {
            if (String.IsNullOrEmpty(Filename))
            {
                return;
            }

            var builder = new BVPImportSourceBuilder(Filename);

            this.RowSource = builder.BuildRowSource();
            // make a matrix of the data - for now all of it, but if it becomes too much, we can limit it to top 100 or so...
            var matrix = new DataMatrix();
            var view   = new GridView();

            for (int i = 0; i < RowSource.ColumnCount; ++i)
            {
                String name = RowSource.ColumnName(i);
                matrix.Columns.Add(new MatrixColumn {
                    Name = name
                });
                var column = new GridViewColumn {
                    Header = BuildColumnHeader(name), DisplayMemberBinding = new Binding(String.Format("[{0}]", i))
                };
                view.Columns.Add(column);
            }

            while (RowSource.MoveNext())
            {
                var row = matrix.AddRow();
                for (int i = 0; i < RowSource.ColumnCount; ++i)
                {
                    row[RowSource.ColumnName(i)] = RowSource[i];
                }
            }

            lvwPreview.ItemsSource = matrix.Rows;
            lvwPreview.View        = view;
        }
        private void PreviewDataSet()
        {
            if (String.IsNullOrEmpty(Filename)) {
                return;
            }

            var builder = new BVPImportSourceBuilder(Filename);
            this.RowSource = builder.BuildRowSource();
            // make a matrix of the data - for now all of it, but if it becomes too much, we can limit it to top 100 or so...
            var matrix = new DataMatrix();
            var view = new GridView();
            for (int i = 0; i < RowSource.ColumnCount; ++i) {
                String name = RowSource.ColumnName(i);
                matrix.Columns.Add(new MatrixColumn { Name = name });
                var column = new GridViewColumn { Header = BuildColumnHeader(name), DisplayMemberBinding = new Binding(String.Format("[{0}]", i)) };
                view.Columns.Add(column);
            }

            while (RowSource.MoveNext()) {
                var row = matrix.AddRow();
                for (int i = 0; i < RowSource.ColumnCount; ++i) {
                    row[RowSource.ColumnName(i)] = RowSource[i];
                }
            }

            lvwPreview.ItemsSource = matrix.Rows;
            lvwPreview.View = view;
        }