コード例 #1
0
        /// <summary>
        /// Reboot the Xbox console and wait no more than the specified amount of time for the console to become responsive again.
        /// </summary>
        /// <param name="configurationToApply">The configuration to apply to the console before it reboots.</param>
        /// <param name="timeout">The maximum amount of time to wait for the Xbox console to become
        /// responsive again after initiating the reboot sequence.</param>
        /// <exception cref="System.TimeoutException">Thrown if the reboot operation does not complete within the given timeout period.</exception>
        public void Reboot(XboxConfiguration configurationToApply, TimeSpan timeout)
        {
            this.ThrowIfDisposed();

            var originalIp = this.SystemIpAddressAndSessionKeyCombined;

            this.ApplyConfiguration(configurationToApply);
            var newIp = this.SystemIpAddressAndSessionKeyCombined;

            this.Adapter.Reboot(originalIp, newIp, timeout);
        }
コード例 #2
0
        /// <summary>
        /// Helper function to apply configuration before rebooting.
        /// </summary>
        /// <param name="configuration">Configuration to apply.</param>
        private void ApplyConfiguration(XboxConfiguration configuration)
        {
            configuration.SetSettingValues((key, value) =>
            {
                if (value != null)
                {
                    this.Adapter.SetConfigValue(this.SystemIpAddressAndSessionKeyCombined, key, value);
                }
            });

            if (configuration.SessionKey != null)
            {
                this.SessionKey = configuration.SessionKey;
            }
        }
コード例 #3
0
        /// <summary>
        /// Reboot the Xbox console and wait indefinitely for the reboot
        /// process to complete.
        /// </summary>
        /// <param name="configurationToApply">The configuration to apply to the console before it reboots.</param>
        public void Reboot(XboxConfiguration configurationToApply)
        {
            this.ThrowIfDisposed();

            this.Reboot(configurationToApply, Timeout.InfiniteTimeSpan);
        }