示例#1
0
 public override void InitializeComponent(ICore core)
 {
     this.Playback        = new global::FoxTunes.ViewModel.Playback(false);
     this.InputManager    = ComponentRegistry.Instance.GetComponent <IInputManager>();
     this.PlaylistManager = core.Managers.Playlist;
     this.PlaybackManager = core.Managers.Playback;
     this.ErrorEmitter    = core.Components.ErrorEmitter;
     this.Configuration   = core.Components.Configuration;
     this.Play            = this.Configuration.GetElement <TextConfigurationElement>(
         InputManagerConfiguration.SECTION,
         InputManagerConfiguration.PLAY_ELEMENT
         );
     this.Previous = this.Configuration.GetElement <TextConfigurationElement>(
         InputManagerConfiguration.SECTION,
         InputManagerConfiguration.PREVIOUS_ELEMENT
         );
     this.Next = this.Configuration.GetElement <TextConfigurationElement>(
         InputManagerConfiguration.SECTION,
         InputManagerConfiguration.NEXT_ELEMENT
         );
     this.Stop = this.Configuration.GetElement <TextConfigurationElement>(
         InputManagerConfiguration.SECTION,
         InputManagerConfiguration.STOP_ELEMENT
         );
     foreach (var element in new[] { this.Play, this.Previous, this.Next, this.Stop })
     {
         if (element == null)
         {
             continue;
         }
         element.ValueChanged += this.OnValueChanged;
     }
     this.Update();
     base.InitializeComponent(core);
 }
示例#2
0
 public override void InitializeComponent(ICore core)
 {
     this.Core                  = core;
     this.Database              = core.Factories.Database.Create();
     this.PlaybackManager       = core.Managers.Playback;
     this.MetaDataSourceFactory = core.Factories.MetaDataSource;
     this.SignalEmitter         = core.Components.SignalEmitter;
     this.ScriptingRuntime      = core.Components.ScriptingRuntime;
     this.MetaDataBrowser       = core.Components.MetaDataBrowser;
     this.Configuration         = core.Components.Configuration;
     this.Sort                  = this.Configuration.GetElement <TextConfigurationElement>(
         PlaylistBehaviourConfiguration.SECTION,
         PlaylistBehaviourConfiguration.PRE_SORT_ORDER_ELEMENT
         );
     base.InitializeComponent(core);
 }
示例#3
0
 public override void InitializeComponent(ICore core)
 {
     this.LibraryManager          = core.Managers.Library;
     this.PlaylistManager         = core.Managers.Playlist;
     this.MetaDataManager         = core.Managers.MetaData;
     this.HierarchyManager        = core.Managers.Hierarchy;
     this.LibraryHierarchyBrowser = core.Components.LibraryHierarchyBrowser;
     this.Configuration           = core.Components.Configuration;
     this.Enabled = this.Configuration.GetElement <BooleanConfigurationElement>(
         PicardConfiguration.SECTION,
         PicardConfiguration.ENABLED_ELEMENT
         );
     this.Path = this.Configuration.GetElement <TextConfigurationElement>(
         PicardConfiguration.SECTION,
         PicardConfiguration.PATH_ELEMENT
         );
     base.InitializeComponent(core);
 }
示例#4
0
 public override void InitializeComponent(ICore core)
 {
     this.PlaybackManager = core.Managers.Playback;
     this.MetaDataManager = core.Managers.MetaData;
     this.Configuration   = core.Components.Configuration;
     this.Enabled         = this.Configuration.GetElement <BooleanConfigurationElement>(
         MetaDataBehaviourConfiguration.SECTION,
         MetaDataBehaviourConfiguration.READ_LYRICS_TAGS
         );
     this.AutoScroll = this.Configuration.GetElement <BooleanConfigurationElement>(
         LyricsBehaviourConfiguration.SECTION,
         LyricsBehaviourConfiguration.AUTO_SCROLL
         );
     this.AutoLookup = this.Configuration.GetElement <BooleanConfigurationElement>(
         LyricsBehaviourConfiguration.SECTION,
         LyricsBehaviourConfiguration.AUTO_LOOKUP
         );
     this.Editor = this.Configuration.GetElement <TextConfigurationElement>(
         LyricsBehaviourConfiguration.SECTION,
         LyricsBehaviourConfiguration.EDITOR
         );
     base.InitializeComponent(core);
 }
示例#5
0
 public static EventHandler Loader(SelectionConfigurationElement presetElement, TextConfigurationElement layoutElement, IEnumerable <Preset> presets)
 {
     return((sender, e) =>
     {
         var preset = presets.FirstOrDefault(
             _preset => string.Equals(_preset.Id, presetElement.Value.Id, StringComparison.OrdinalIgnoreCase)
             );
         if (preset == null)
         {
             //The slected preset was not found.
             return;
         }
         layoutElement.Value = preset.Layout;
     });
 }