public OpenVASAgent CreateAgent(OpenVASAgent agent) { if (agent.RemoteAgentID != Guid.Empty) { throw new Exception("This agent has already been created."); } XmlDocument response = this.CreateAgent(agent.Installer, agent.Signature, agent.Name); foreach (XmlAttribute attr in response.Attributes) { if (attr.Name == "id") { agent.RemoteAgentID = new Guid(attr.Value); } } return(agent); }
public OpenVASAgent CreateAgent(OpenVASAgent agent) { if (agent.RemoteAgentID != Guid.Empty) throw new Exception("This agent has already been created."); XmlDocument response = this.CreateAgent(agent.Installer, agent.Signature, agent.Name); foreach (XmlAttribute attr in response.Attributes) { if (attr.Name == "id") agent.RemoteAgentID = new Guid(attr.Value); } return agent; }