public DeviceRegistrationRequest(Guid applicationId, LiveDevice device)
            : this()
        {
            if (null == device)
            {
                throw new ArgumentNullException("device");
            }

            this.ClientInfo = new DeviceRegistrationClientInfo()
            {
                ApplicationId = applicationId, Version = "1.0"
            };
            this.Authentication = new DeviceRegistrationAuthentication()
            {
                MemberName = device.User.DeviceId,
                Password   = device.User.DecryptedPassword
            };
        }
        private static DeviceRegistrationResponse RegisterDevice(Guid applicationId, ClientCredentials deviceCredentials)
        {
            var userName = new DeviceUserName()
            {
                DeviceName = deviceCredentials.UserName.UserName, DecryptedPassword = deviceCredentials.UserName.Password
            };

            var device = new LiveDevice()
            {
                User = userName, Version = 1
            };

            var request = new DeviceRegistrationRequest(applicationId, device);

            string url = string.Format(CultureInfo.InvariantCulture, LiveIdConstants.RegistrationEndpointUriFormat, string.Empty);

            return(ExecuteRegistrationRequest(url, request));
        }