Esempio n. 1
0
 /// <summary>
 /// calls <see cref="ThreadedResultWorker{TArgs,TCompletedArgs}" />
 /// </summary>
 /// <param name="infoBuilder">The info builder.</param>
 /// <param name="storageAdapter">The storage adapter.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="configurationManager">The configuration manager.</param>
 /// <param name="threadManager">The thread manager service.</param>
 /// <param name="publicTransport">The public transport.</param>
 public RecursiveAsyncFileScanner(IInfoBuilder <TInfo> infoBuilder,
                                  IDataPersister <TInfo> storageAdapter,
                                  IConfigurationManager configurationManager,
                                  IThreadManager threadManager,
                                  IPublicTransport publicTransport,
                                  ILogger logger)
     : base(logger)
 {
     infoBuilder.Guard("infoBuilder");
     storageAdapter.Guard("storageAdapter");
     configurationManager.Guard("configurationManager");
     threadManager.Guard("threadManagerService");
     publicTransport.Guard("publicTransport");
     this.infoBuilder     = infoBuilder;
     this.storageAdapter  = storageAdapter;
     this.threadManager   = threadManager;
     this.publicTransport = publicTransport;
     pageSize             = configurationManager.GetValue("PageSize", 2000, "File Scanner");
     scanPaged            = configurationManager.GetValue("ScanPaged", true, "File Scanner");
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PlaylistViewModel" /> class.
 /// </summary>
 /// <param name="publicTransport">The public transport.</param>
 /// <param name="playlistService">The playlist service.</param>
 /// <param name="dispatcher">The dispatcher.</param>
 /// <param name="playerService">The audio player service.</param>
 /// <param name="builder">The builder.</param>
 /// <param name="configurationManager">The configuration manager.</param>
 /// <param name="globalHotkeyService">The global hotkey service.</param>
 /// <param name="windowManager">The window manager.</param>
 /// <param name="searchView">The search view.</param>
 /// <param name="serializerService">The serializer service.</param>
 /// <param name="logger">The logger.</param>
 public PlaylistViewModel(IPublicTransport publicTransport,
                          IPlaylistService playlistService,
                          IDispatcher dispatcher,
                          IPlayerService playerService,
                          IInfoBuilder <StorableTaggedFile> builder,
                          IConfigurationManager configurationManager,
                          IGlobalHotkeyService globalHotkeyService,
                          IWindowManager windowManager,
                          ISearchView searchView,
                          ISerializerService serializerService,
                          ILogger logger)
     : base(logger)
 {
     publicTransport.Guard("publicTransport");
     playlistService.Guard("playlistService");
     dispatcher.Guard("dispatcher");
     playerService.Guard("playerService");
     builder.Guard("builder");
     configurationManager.Guard("configurationManager");
     globalHotkeyService.Guard("globalHotkeyService");
     windowManager.Guard("windowManager");
     searchView.Guard("searchView");
     serializerService.Guard("serializerService");
     this.playlistService     = playlistService;
     this.dispatcher          = dispatcher;
     this.playerService       = playerService;
     this.builder             = builder;
     this.globalHotkeyService = globalHotkeyService;
     this.windowManager       = windowManager;
     this.searchView          = searchView;
     publicTransport.ApplicationEventBus.Subscribe <PlaylistUpdatedEvent>(OnPlaylistUpdated);
     publicTransport.ApplicationEventBus.Subscribe <TrackChangedEvent>(OnTrackChanged);
     searchHotkey = configurationManager.GetValue("Search", new HotkeyDescriptor(ModifierKeys.Control | ModifierKeys.Alt, Key.J),
                                                  KnownConfigSections.GlobalHotkeys);
     searchHotkey.ValueChanged += SearchHotkeyOnValueChanged;
     globalHotkeyService.RegisterHotkey(searchHotkey.Value, OnSearch);
     //globalHotkeyService.RegisterHotkey(new HotkeyDescriptor(ModifierKeys.None, Key.A), () => MessageBox.Show("Stuff"));
     searchView.PlayFile += SearchViewOnPlayFile;
     Files = new List <FileItem>(playlistService.Files.Select(x => new FileItem(x)));
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StorableTaggedFileBuilder" /> class.
 /// </summary>
 /// <param name="sourceBuilder">The source builder.</param>
 public StorableTaggedFileBuilder(IInfoBuilder <ID3File> sourceBuilder)
 {
     sourceBuilder.Guard("sourceBuilder");
     this.sourceBuilder = sourceBuilder;
 }