I am creating a class to log geometries to shapefiles. So I create an instance of a GeometryLogger which holds a reference to a IFeatureClass. To write to the file I open an editsession once the featureclass has been created and opened. However I´m unsure when I should close the session. Is this done autoamtically when GC kicks the logger-instance away or should I do it within the loggers destructor or using IDisposable.Dispose?
class GeometryFileLogger { private IFeatureClass m_featureClass; public GeometryFileLogger(string file) { this.CreateFeatureClass(file); this.OpenSession(); } public void Write(IGeometry geometry) { // ... }}
أكثر...
class GeometryFileLogger { private IFeatureClass m_featureClass; public GeometryFileLogger(string file) { this.CreateFeatureClass(file); this.OpenSession(); } public void Write(IGeometry geometry) { // ... }}
أكثر...