public static BasicMapElements?DetermineMapElementsFromShapeFile(string fileName, out ShapeType?unsupportedShapeType)
        {
            ShapeFileReader shapeFileReader = new ShapeFileReader();

            shapeFileReader.FileName = fileName;
            return(shapeFileReader.DetermineMapElements(out unsupportedShapeType));
        }
        public static BasicMapElements?DetermineMapElementsFromShapeFile(Stream shpStream, out ShapeType?unsupportedShapeType)
        {
            ShapeFileReader shapeFileReader = new ShapeFileReader();

            shapeFileReader.ShpStream = shpStream;
            return(shapeFileReader.DetermineMapElements(out unsupportedShapeType));
        }
 public void Load()
 {
     if (this.ShpStream != null)
     {
         BinaryReader binaryReader = new BinaryReader(this.ShpStream);
         try
         {
             this.ReadHeader(binaryReader);
             this.ReadShapes(binaryReader);
         }
         finally
         {
             binaryReader.Close();
         }
         if (this.DbfStream != null)
         {
             SqlBytes data = new SqlBytes(this.dbfStream);
             DBF      dBF  = new DBF(data);
             this.Table = dBF.GetDataTable();
         }
     }
     else
     {
         using (FileStream input = new FileStream(this.FileName, FileMode.Open, FileAccess.Read))
         {
             BinaryReader binaryReader2 = new BinaryReader(input);
             try
             {
                 this.ReadHeader(binaryReader2);
                 this.ReadShapes(binaryReader2);
             }
             finally
             {
                 binaryReader2.Close();
             }
         }
         string path = this.FileName.Substring(0, this.FileName.LastIndexOf('.')) + ".dbf";
         if (File.Exists(path))
         {
             SqlBytes data2 = ShapeFileReader.File2SqlBytes(path);
             DBF      dBF2  = new DBF(data2);
             this.Table = dBF2.GetDataTable();
         }
     }
 }
        public static DataTable ReadDBFThroughOLEDB(string fullPath)
        {
            int    num  = fullPath.LastIndexOf("\\", StringComparison.Ordinal);
            string str  = fullPath.Substring(0, num + 1);
            string text = fullPath.Substring(num + 1);

            text = text.Substring(0, text.LastIndexOf('.'));
            if (text.Length > 8)
            {
                text = ShapeFileReader.GetShortFileName(fullPath, text);
                text = text.Substring(0, text.LastIndexOf('.'));
            }
            string  connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + str + "; Extended Properties=dBase 5.0;";
            string  sql     = "SELECT * FROM [" + text + "#DBF]";
            DataSet dataSet = ShapeFileReader.GetDataSet(connectionString, sql);

            return(dataSet.Tables[0]);
        }