public void CleanUp() { if (_fTab != null) { _fTab.ReleaseCursor(); _fTab.Dispose(); _fTab = null; } }
async private Task ProcessFeatureClass(IFeatureClass fc, IQueryFilter filter) { CleanUp(); if (fc != null) { _cursor = await fc.Search(filter); if (_cursor == null) { return; } _fTab = new FeatureTable(_cursor as IFeatureCursor, fc.Fields, fc); _fTab.RowsAddedToTable += new RowsAddedToTableEvent(fTab_RowsAddedToTable); try { await _fTab.Fill(_firstFillMaximum, _cancelTracker); } catch (System.Threading.ThreadAbortException) { _fTab.ReleaseCursor(); return; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!_fTab.hasMore || (_cancelTracker != null && !_cancelTracker.Continue && !_cancelTracker.Paused)) { _fTab.ReleaseCursor(); _cursor = null; if (ThreadFinished != null) { ThreadFinished(); } } else { if (Paused != null) { Paused(); } } } else { if (ThreadFinished != null) { ThreadFinished(); } } }
private void ProcessFeatureClassByID(IFeatureClass fc, List <int> ids) { CleanUp(); if (fc != null) { _fTab = new FeatureTable(null, fc.Fields, fc); //if (Progress != null) Progress(); _fTab.Fill(ids, _cancelTracker); if (!_fTab.hasMore || (_cancelTracker != null && !_cancelTracker.Continue && !_cancelTracker.Paused)) { _fTab.ReleaseCursor(); _cursor = null; if (ThreadFinished != null) { ThreadFinished(); } } else { if (Paused != null) { Paused(); } } } else { if (ThreadFinished != null) { ThreadFinished(); } } }