示例#1
0
        public hMailServer.Alias AddAlias(hMailServer.Domain domain, string sName, string sValue)
        {
            hMailServer.Alias oAlias = domain.Aliases.Add();
            oAlias.Name   = sName;
            oAlias.Value  = sValue;
            oAlias.Active = true;
            oAlias.Save();

            return(oAlias);
        }
示例#2
0
        public bool SaveData()
        {
            bool newObject = false;

            if (representedObject == null)
            {
                hMailServer.Domain domain = APICreator.GetDomain(_domainID);

                hMailServer.Aliases aliases = domain.Aliases;
                representedObject = aliases.Add();
                newObject         = true;

                Marshal.ReleaseComObject(domain);
                Marshal.ReleaseComObject(aliases);
            }


            representedObject.Name   = textName.Text;
            representedObject.Value  = textValue.Text;
            representedObject.Active = checkEnabled.Checked;

            representedObject.Save();

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

            mainForm.RefreshCurrentNode(representedObject.Name);

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

            if (newObject)
            {
                SearchNodeText crit = new SearchNodeText(representedObject.Name);
                mainForm.SelectNode(crit);
            }

            return(true);
        }
示例#3
0
 public void Save()
 {
     _object.Save();
 }