Opc.Ua.Configuration.FirewallAccessDlg.ApplicationAccessGrantedCK_CheckedChanged C# (CSharp) Method

ApplicationAccessGrantedCK_CheckedChanged() private method

private ApplicationAccessGrantedCK_CheckedChanged ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void ApplicationAccessGrantedCK_CheckedChanged(object sender, EventArgs e)
        {
            try
            {
                if (m_application != null)
                {
                    bool accessible = ConfigUtils.CheckFirewallAccess(m_application.ExecutablePath, null);

                    if (ApplicationAccessGrantedCK.Checked)
                    {
                        if (!accessible)
                        {
                            ConfigUtils.SetFirewallAccess(m_application.ExecutablePath, null);
                        }
                    }
                    else
                    {
                        if (accessible)
                        {
                            ConfigUtils.RemoveFirewallAccess(m_application.ExecutablePath, null);
                        }
                    }
                }
                
                PortsLV.Enabled = ApplicationAccessGrantedCK.Checked;
                AddBTN.Enabled = PortsLV.Enabled;
                RemoveBTN.Enabled = PortsLV.Enabled;
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, System.Reflection.MethodBase.GetCurrentMethod(), exception);
            }
        }
        #endregion