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;
}