Пример #1
0
        public override Collection <FeatureSourceColumn> GetColumnToAdd(string filePath, string customParameter)
        {
            Collection <FeatureSourceColumn> result = new Collection <FeatureSourceColumn>();
            CsvFeatureSource csvFeatureSource       = new CsvFeatureSource();

            csvFeatureSource.DelimitedPathFilename = filePath;
            csvFeatureSource.Delimiter             = customParameter;
            csvFeatureSource.RequireIndex          = false;
            csvFeatureSource.Open();
            foreach (var column in csvFeatureSource.GetColumns())
            {
                DataJoinFeatureSourceColumn csvColumn = new DataJoinFeatureSourceColumn(column.ColumnName, column.TypeName, column.MaxLength);
                result.Add(csvColumn);
            }
            csvFeatureSource.Close();

            return(result);
        }
        public override Collection <FeatureSourceColumn> GetColumnToAdd(string filePath, string customParameter)
        {
            Collection <FeatureSourceColumn> result = new Collection <FeatureSourceColumn>();

            using (GeoDbf geoDbf = new GeoDbf(filePath, GeoFileReadWriteMode.Read))
            {
                geoDbf.Open();
                var columns = geoDbf.GetAllColumns();
                foreach (var item in columns)
                {
                    DataJoinFeatureSourceColumn csvColumn = new DataJoinFeatureSourceColumn(item.ColumnName, item.TypeName, item.MaxLength);
                    result.Add(csvColumn);
                }

                geoDbf.Close();
            }

            return(result);
        }