コード例 #1
0
        public BasFeatureEntity GetFeatureEntityByOffset(long offset)
        {
            BasFeatureEntity feature = null;

            basReader.BaseStream.Seek(offset, SeekOrigin.Begin);

            BasEntity entity = BasEntityParser.Parse(basReader);

            if (entity != null)
            {
                feature = BasEntityToFeatureEntityConverter.Convert(entity);
            }

            return(feature);
        }
コード例 #2
0
        public Collection <BasFeatureEntity> GetAllFeatureEntities()
        {
            Collection <BasFeatureEntity> features = new Collection <BasFeatureEntity>();

            basReader.BaseStream.Seek(0, SeekOrigin.Begin);
            while (basReader.BaseStream.Position != -1 && basReader.BaseStream.Length - basReader.BaseStream.Position > 80)
            {
                BasEntity entity = BasEntityParser.Parse(basReader);

                if (entity != null)
                {
                    features.Add(BasEntityToFeatureEntityConverter.Convert(entity));
                }
            }
            return(features);
        }
コード例 #3
0
        public Collection <string> GetColumns()
        {
            Collection <string> allColumns = new Collection <string>();

            basReader.BaseStream.Seek(0, SeekOrigin.Begin);
            BasEntity firstRecord = BasEntityParser.Parse(basReader);

            if (firstRecord != null)
            {
                foreach (var column in Enum.GetValues(typeof(BasDefaultColumns)))
                {
                    allColumns.Add(column.ToString());
                }
                foreach (var column in firstRecord.HeaderResult.VariableData.Keys)
                {
                    allColumns.Add(column);
                }
            }

            return(allColumns);
        }