hMailServer.Administrator.ucAntiVirus.SaveData C# (CSharp) Method

SaveData() public method

public SaveData ( ) : bool
return bool
        public bool SaveData()
        {
            hMailServer.Settings settings = APICreator.Application.Settings;
            hMailServer.AntiVirus antiVirusSettings = settings.AntiVirus;

            antiVirusSettings.Action = radioDeleteEmail.Checked ? eAntivirusAction.hDeleteEmail : eAntivirusAction.hDeleteAttachments;

            antiVirusSettings.NotifySender = checkNotifySender.Checked;
            antiVirusSettings.NotifyReceiver = checkNotifyReceiver.Checked;
            antiVirusSettings.MaximumMessageSize = textVirusScanMaxSize.Number;

            antiVirusSettings.ClamWinEnabled = checkUseClamWin.Checked;
            antiVirusSettings.ClamWinExecutable = textClamScanExecutable.Text;
            antiVirusSettings.ClamWinDBFolder = textClamScanDatabase.Text;

            antiVirusSettings.CustomScannerEnabled = checkUseCustomScanner.Checked;
            antiVirusSettings.CustomScannerExecutable = textCustomScannerExecutable.Text;
            antiVirusSettings.CustomScannerReturnValue = textCustomScannerReturnValue.Number;

            antiVirusSettings.EnableAttachmentBlocking = checkBlockAttachmentsEnabled.Checked;

            antiVirusSettings.ClamAVHost = textClamAVHostName.Text;
            antiVirusSettings.ClamAVPort = textClamAVPort.Number;
            antiVirusSettings.ClamAVEnabled = checkClamAVEnabled.Checked;

            DirtyChecker.SetClean(this);

            Marshal.ReleaseComObject(settings);
            Marshal.ReleaseComObject(antiVirusSettings);

            return true;
        }