示例#1
0
 public override void InitializeComponent(ICore core)
 {
     this.PlaylistManager = core.Managers.Playlist;
     this.PlaylistCache   = core.Components.PlaylistCache;
     this.DatabaseFactory = core.Factories.Database;
     this.PlaylistNavigationStrategyFactory = ComponentRegistry.Instance.GetComponent <PlaylistNavigationStrategyFactory>();
     this.Configuration = core.Components.Configuration;
     this.Configuration.GetElement <SelectionConfigurationElement>(
         PlaylistBehaviourConfiguration.SECTION,
         PlaylistBehaviourConfiguration.ORDER_ELEMENT
         ).ConnectValue(option => this.NavigationStrategy = this.PlaylistNavigationStrategyFactory.Create(option.Id));
     base.InitializeComponent(core);
 }
示例#2
0
 public override void InitializeComponent(ICore core)
 {
     this.Core            = core;
     this.PlaylistCache   = core.Components.PlaylistCache;
     this.DatabaseFactory = core.Factories.Database;
     this.Configuration   = core.Components.Configuration;
     this.Configuration.GetElement <BooleanConfigurationElement>(
         PlaylistBehaviourConfiguration.SECTION,
         PlaylistBehaviourConfiguration.SHUFFLE_ELEMENT
         ).ConnectValue(value =>
     {
         if (value)
         {
             this.NavigationStrategy = new ShufflePlaylistNavigationStrategy();
         }
         else
         {
             this.NavigationStrategy = new StandardPlaylistNavigationStrategy();
         }
         this.NavigationStrategy.InitializeComponent(this.Core);
     });
     base.InitializeComponent(core);
 }