コード例 #1
0
        /// <summary>
        /// Thread to perform reboot
        /// </summary>
        private void RebootThread()
        {
            TvBusinessLayer layer  = new TvBusinessLayer();
            EPGWakeupConfig config = new EPGWakeupConfig((layer.GetSetting("PowerSchedulerRebootConfig", String.Empty).Value));

            Log.Debug("RebootHandler: Reboot schedule {0:00}:{1:00} is due", config.Hour, config.Minutes);

            // Start external command
            RunExternalCommand("reboot");

            // Trigger reboot
            Log.Info("RebootHandler: Reboot system");
            IPowerScheduler ps = GlobalServiceProvider.Instance.Get <IPowerScheduler>();

            ps.SuspendSystem("RebootHandler", (int)RestartOptions.Reboot, false);
        }
コード例 #2
0
        /// <summary>
        /// Thread to perform reboot
        /// </summary>
        private void RebootThread()
        {
            using (Settings reader = new MPSettings())
            {
                EPGWakeupConfig config = new EPGWakeupConfig(reader.GetValueAsString("psclientplugin", "RebootConfig", String.Empty));

                Log.Debug("RebootHandler: Reboot schedule {0:00}:{1:00} is due", config.Hour, config.Minutes);

                // Start external command
                RunExternalCommand("reboot");

                // Trigger reboot
                Log.Info("RebootHandler: Reboot system");
                IPowerScheduler ps = GlobalServiceProvider.Instance.Get <IPowerScheduler>();
                ps.SuspendSystem("RebootHandler", (int)RestartOptions.Reboot, false);
            }
        }