public void Dispose() { try { if (_grids != null) { foreach (IGrid grid in _grids) { grid.Dispose(); } _grids.Clear(); } if (_dataSource != null) { _dataSource.DataSourceChanged -= new EventHandler(DataSourceChanged); _dataSource.Dispose(); _dataSource = null; } _currentRuntimeProjecter = null; _gridDefinition = null; _limiter = null; } finally { _disposed = true; } }
public FeatureClass(FeatureDataSourceBase dataSource) { _gridDefinition = new GridDefinition(); _limiter = new MemoryGridLimiter(); _dataSource = dataSource; _spatialReference = _dataSource.GetSpatialReference(); InitConstructor(); }
public FeatureClass(string filename) { _gridDefinition = new GridDefinition(); _limiter = new MemoryGridLimiter(); _dataSource = new FileDataSource(Path.GetFileNameWithoutExtension(filename), filename); _spatialReference = _dataSource.GetSpatialReference(); InitConstructor(); }
public static IFeatureClass FromXElement(XElement ele) { if (ele == null) { return(null); } GridDefinition gridDef = GridDefinition.FromXElement(ele.Element("GridDef")); MemoryGridLimiter limiter = MemoryGridLimiter.FromXElement(ele.Element("MemoryLimiter")); object ds = PersistObject.ReflectObjFromXElement(ele.Element("DataSource")); if (ds == null) { return(null); } FeatureDataSourceBase dataSource = (FeatureDataSourceBase)ds; return(new FeatureClass(gridDef, limiter, dataSource)); }
public FeatureClass(GridDefinition gridDef, MemoryGridLimiter limiter, FeatureDataSourceBase dataSource) { if (gridDef != null) { _gridDefinition = gridDef; } if (limiter != null) { _limiter = limiter; } if (dataSource == null) { throw new ArgumentNullException("构造VectorFeatureClass对象,\"DataSource\"不能为空。"); } _dataSource = dataSource; _dataSource.SetFeatureClass(this); _spatialReference = _dataSource.GetSpatialReference(); InitConstructor(); }
public static MemoryGridLimiter FromXElement(XElement ele) { if (ele == null) { return(null); } string type = ele.Attribute("type").Value; enumGridLimitType t = enumGridLimitType.None; foreach (enumGridLimitType it in Enum.GetValues(typeof(enumGridLimitType))) { if (it.ToString() == type) { t = it; break; } } MemoryGridLimiter mgt = new MemoryGridLimiter(); mgt.Count = int.Parse(ele.Attribute("maxcount").Value); mgt.MaxMemorySize = int.Parse(ele.Attribute("maxmemory").Value); return(mgt); }