protected virtual void OnStatusChange(StatusChangeEventArgs e) { if (StatusChange != null) { // Invokes the delegates. StatusChange(this, e); } }
private void _form_StatusChange(object sender, StatusChangeEventArgs e) { IMap theMap = null; try { if (this._selectedErrors != null) { this.Extension.QAManager.ApplyNewStatusToErrors(this._selectedErrors, e.NewStatus); // Refresh the form view ErrorDisplay[] theDisplayErrors = new ErrorDisplay[this._selectedErrors.Length]; for (int i = 0; i < theDisplayErrors.Length; i++) { dao.QAError theError = this._selectedErrors[i]; theDisplayErrors[i] = new ErrorDisplay( theError.ObjectID, theError.Error.Status, theError.Error.ErrorType, theError.Error.CanDefer, theError.Error.CanExcept); } this._form.UpdateErrors(theDisplayErrors); // Detail view if (this._selectedErrors.Length == 1) this._form.SetDetailError(this._selectedErrors[0]); // Map view theMap = this.Extension.FocusMap; IActiveView theAV = (IActiveView)theMap; theAV.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, theAV.Extent); } } catch (dao.ErrorStorageException ese) { util.Logger.Write("ErrorStorageException caught changing the status of errors: " + Environment.NewLine + ese.Message + Environment.NewLine + ese.StackTrace); MessageBox.Show("Error occurred trying to open and write to the SUITT exceptions table. See log for more details", "Error Accessing SUITT Table", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (Exception ex) { util.Logger.Write("Exception caught changing the status of errors: " + Environment.NewLine + ex.Message + Environment.NewLine + ex.StackTrace); } finally { if (theMap != null) Marshal.ReleaseComObject(theMap); } }