ActionResultBase IDomainEdit.Edit(DomainItem DomainToEdit, IOptionData properties)
        {
            cPanel_Domain cpDomain = DomainToEdit as cPanel_Domain;

            if (cpDomain == null)
            {
                throw new ArgumentException("Wrong type of argument, the expected cPanel_Domain type.", "Domain");
            }
            cPanel_ActionResult result = new cPanel_ActionResult();

            result.DataNodeProccessor = new cPanel_ActionResult.DataNodeHandler((nodeList) =>
            {
                if (nodeList != null)
                {
                    return(ActionResultCode.Success);
                }
                return(ActionResultCode.Error_UknowError);
            });
            CommandArgs[] commands = new CommandArgs[]
            {
                new CommandArgs("rootdomain", cpDomain.ExtViewData["rootdomain"]),
                new CommandArgs("subdomain", cpDomain.ExtViewData["subdomain"]),
                properties.ToCommandArgs(cpDomain.Name)[0]
            };
            result.ExecuteQuery(WebNetCommunication.BuildGetRequest(BuildCommandQuery("SubDomain", "changedocroot", commands), this.Account.WebSession));
            return(result);
        }
        ActionResultBase IDomainRemove.RemoveOject(DomainItem DomainToRemove)
        {
            cPanel_Domain cpDomain = DomainToRemove as cPanel_Domain;

            if (cpDomain == null)
            {
                throw new ArgumentException("Wrong type of argument, the expected cPanel_Domain type.", "Domain");
            }
            cPanel_ActionResult result = new cPanel_ActionResult();

            result.DataNodeProccessor = new cPanel_ActionResult.DataNodeHandler((nodeList) =>
            {
                if (nodeList != null)
                {
                    string status = nodeList[0]["reason"].InnerText;
                    if (status.Contains("Deleted domain:") || status.Contains("Bind reloading"))
                    {
                        return(ActionResultCode.Success);
                    }
                }
                return(ActionResultCode.Error_UknowError);
            });
            CommandArgs[] commands = new CommandArgs[]
            {
                new CommandArgs("domain", cpDomain.Name),
                new CommandArgs("subdomain", cpDomain.ExtViewData["domainkey"]),
                new CommandArgs("user", cpDomain.ExtViewData["subdomain"])
            };
            result.ExecuteQuery(WebNetCommunication.BuildGetRequest(BuildCommandQuery("AddonDomain", "deladdondomain", commands), this.Account.WebSession));
            return(result);
        }