private void RefreshData(DotSpatial.Symbology.ILayer iLayer) { DataTable table = null; if (iLayer == null) { return; } if (iLayer is IFeatureLayer) { var ifs = iLayer as IFeatureLayer; if (ifs.DataSet != null) { table = ifs.DataSet.DataTable; } } else { table = GetDataFromCurrentLayer(iLayer); } BindData(table); if (iLayer != null) { this.Text = String.Format("ADE - {0}", iLayer.LegendText); } else { this.Text = "ADE"; } }
private DataTable GetDataFromCurrentLayer(DotSpatial.Symbology.ILayer iLayer) { var layer = iLayer as IMapFeatureLayer; if (layer == null || layer.DataSet == null || layer.DataSet.Filename == null) { return(null); } return(FdoHelper.GetDataFromFile(layer.DataSet.Filename)); // Using DS //if (layer != null) // return layer.DataSet.DataTable; }