Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 public static Computer GetLocalHost()
 {
     var computer = new Computer
     {
         ComputerName = Dns.GetHostName(),
         Version = Environment.OSVersion.VersionString,
         IPAddress = LocalIPAddress()
     };
     return computer;
 }