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

SaveData() public method

public SaveData ( ) : bool
return bool
        public bool SaveData()
        {
            bool newObject = false;
            if (_representedObject == null)
            {
                hMailServer.SURBLServers surblServers = APICreator.SURBLServers;
                _representedObject = surblServers.Add();
                newObject = true;

                Marshal.ReleaseComObject(surblServers);
            }

            _representedObject.Active = checkEnabled.Checked;

            _representedObject.DNSHost = textDNSHost.Text;
            _representedObject.RejectMessage = textRejectionMessage.Text;
            _representedObject.Score = textSpamScore.Number;

            _representedObject.Save();

            // Refresh the node in the tree if the name has changed.
            IMainForm mainForm = Instances.MainForm;
            mainForm.RefreshCurrentNode(null);

            // Set the object to clean.
            DirtyChecker.SetClean(this);

            if (newObject)
            {
                SearchNodeText crit = new SearchNodeText(_representedObject.DNSHost);
                mainForm.SelectNode(crit);
            }

            return true;
        }