public static Computer FromXElement(XElement xComputer) { //return xComputer.GetObjectFromXElement() as Computer; var computer = new Computer { _id = xComputer.GetAttributeValue(Constants._ID), Created = DateTime.Parse(xComputer.GetAttributeValue("Created")), Updated = DateTime.Parse(xComputer.GetAttributeValue("Updated")), ComputerName = xComputer.GetAttributeValue("ComputerName"), IPAddress = xComputer.GetAttributeValue("IPAddress"), Version = xComputer.GetAttributeValue("Version"), Status = xComputer.GetAttributeValue("Status"), DefaultURL = xComputer.GetAttributeValue("DefaultURL") }; return computer; }
public static Computer GetLocalHost() { var computer = new Computer { ComputerName = Dns.GetHostName(), Version = Environment.OSVersion.VersionString, IPAddress = LocalIPAddress() }; return computer; }