public override void InitializeComponent(ICore core)
 {
     this.PlaybackManager = core.Managers.Playback;
     this.Configuration   = core.Components.Configuration;
     this.Sleep           = this.Configuration.GetElement <SelectionConfigurationElement>(
         ExecutionStateBehaviourConfiguration.SECTION,
         ExecutionStateBehaviourConfiguration.SLEEP_ELEMENT
         );
     this.OnlyWhilePlaying = this.Configuration.GetElement <BooleanConfigurationElement>(
         ExecutionStateBehaviourConfiguration.SECTION,
         ExecutionStateBehaviourConfiguration.ONLY_WHILE_PLAYING_ELEMENT
         );
     this.Sleep.ConnectValue(value =>
     {
         this.ExecutionState = ExecutionStateBehaviourConfiguration.GetExecutionState(this.Sleep.Value);
         if (!this.SetThreadExecutionState())
         {
             //If we can't set execution state then don't bother starting the timer.
         }
         if (this.ExecutionState.HasFlag(EXECUTION_STATE.ES_SYSTEM_REQUIRED) || this.ExecutionState.HasFlag(EXECUTION_STATE.ES_DISPLAY_REQUIRED))
         {
             this.Enable();
         }
         else
         {
             this.Disable();
         }
     });
     base.InitializeComponent(core);
 }
 public override void InitializeComponent(ICore core)
 {
     this.PlaybackManager = core.Managers.Playback;
     this.Configuration   = core.Components.Configuration;
     this.Configuration.GetElement <SelectionConfigurationElement>(
         ExecutionStateBehaviourConfiguration.SECTION,
         ExecutionStateBehaviourConfiguration.SLEEP_ELEMENT
         ).ConnectValue(value => this.ExecutionState = ExecutionStateBehaviourConfiguration.GetExecutionState(value));
     base.InitializeComponent(core);
 }
 public IEnumerable <ConfigurationSection> GetConfigurationSections()
 {
     return(ExecutionStateBehaviourConfiguration.GetConfigurationSections());
 }