protected override void OnDisposing() { if (Handle != IntPtr.Zero) { if (ecf != null) { if (this.Ativo) { Desativar(); } if (ecf.Ativo) { ecf.Desativar(); } var oecf = ecf; ecf = null; if (oecf.RFD != null) { oecf.RFD = null; } } CallDestroy(ACBrRFDInterop.RFD_Destroy); } }
public void Desativar() { try { acbrECF.Desativar(); messageToolStripStatusLabel.Text = "OK"; descriptionToolStripStatusLabel.Text = string.Empty; } catch (NullReferenceException) { messageToolStripStatusLabel.Text = "Não inicializado."; descriptionToolStripStatusLabel.Text = string.Empty; } catch (Exception exception) { messageToolStripStatusLabel.Text = "Exception"; descriptionToolStripStatusLabel.Text = exception.Message; } }