hMailServer.Administrator.ucIPRanges.buttonDefault_Click C# (CSharp) Method

buttonDefault_Click() private method

private buttonDefault_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void buttonDefault_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show(Strings.Localize("This operation will change the configuration of the IP ranges back to their default values. Are you sure you want to do this?"), EnumStrings.hMailServerAdministrator, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                hMailServer.Application app = APICreator.Application;

                hMailServer.Settings settings = app.Settings;
                hMailServer.SecurityRanges securityRanges = settings.SecurityRanges;

                securityRanges.SetDefault();

                Marshal.ReleaseComObject(settings);
                Marshal.ReleaseComObject(securityRanges);

                LoadList();

                Instances.MainForm.RefreshCurrentNode(null);
            }
        }