Exemple #1
0
        public PlayerMorePopupViewBindingModel(
            IMediaElementContainer mediaElementContainer,
            IPlayQueueService playQueueService,
            IEventAggregator eventAggregator,
            IApplicationStateService stateService,
            IApplicationResources applicationResources,
            IDispatcher dispatcher)
        {
            this.mediaElementContainer = mediaElementContainer;
            this.playQueueService      = playQueueService;
            this.eventAggregator       = eventAggregator;
            this.stateService          = stateService;
            this.applicationResources  = applicationResources;
            this.dispatcher            = dispatcher;

            this.RegisterForDispose(this.eventAggregator.GetEvent <QueueChangeEvent>().Subscribe(
                                        async(e) => await this.dispatcher.RunAsync(() =>
            {
                this.RaisePropertyChanged(() => this.IsShuffleEnabled);
                this.RaisePropertyChanged(() => this.IsRepeatAllEnabled);
            })));

            this.RegisterForDispose(this.eventAggregator.GetEvent <ApplicationStateChangeEvent>().Subscribe(
                                        async(e) => await this.dispatcher.RunAsync(() => this.RaisePropertyChanged(() => this.IsOnlineMode))));
        }
        protected PlaylistsPageViewPresenterBase(
            IApplicationResources resources,
            IPlaylistsService playlistsService,
            INavigationService navigationService,
            IPlayQueueService playQueueService,
            ISongsCachingService cachingService,
            IApplicationStateService stateService,
            IRadioStationsService radioStationsService,
            ISettingsService settingsService)
        {
            this.resources            = resources;
            this.playlistsService     = playlistsService;
            this.navigationService    = navigationService;
            this.playQueueService     = playQueueService;
            this.cachingService       = cachingService;
            this.stateService         = stateService;
            this.radioStationsService = radioStationsService;
            this.settingsService      = settingsService;

            Func <bool> canExecute = () => this.BindingModel.SelectedItems.Count > 0 &&
                                     this.BindingModel.SelectedItems.All(x => (x.Playlist.PlaylistType == PlaylistType.UserPlaylist && !((UserPlaylist)x.Playlist).IsShared));

            this.PlayCommand       = new DelegateCommand(this.Play);
            this.QueueCommand      = new DelegateCommand(this.Queue, canExecute);
            this.DownloadCommand   = new DelegateCommand(this.Download, canExecute);
            this.UnPinCommand      = new DelegateCommand(this.UnPin, canExecute);
            this.StartRadioCommand = new DelegateCommand(this.StartRadio, () => this.BindingModel != null && this.BindingModel.SelectedItems.Count == 1);
        }
Exemple #3
0
        public LastfmAuthentificationPresenter(
            IApplicationResources resources,
            ILastfmAccountWebService accountWebService,
            ICurrentSongPublisherService publisherService)
        {
            this.resources         = resources;
            this.accountWebService = accountWebService;
            this.publisherService  = publisherService;
            this.BindingModel      = new LastfmAuthentificationBindingModel
            {
                IsLoading = true,
                Message   = this.resources.GetString("LastFmAuthentification_Instruction")
            };

            this.accountWebService.GetTokenAsync().ContinueWith(
                t =>
            {
                if (t.IsCompleted && !t.IsFaulted && string.IsNullOrEmpty(t.Result.Error) &&
                    !string.IsNullOrEmpty(t.Result.Token))
                {
                    this.BindingModel.IsLoading = false;
                    var launchTask = Launcher.LaunchUriAsync(new Uri(this.BindingModel.LinkUrl = this.accountWebService.GetAuthUrl(this.token = t.Result.Token)));
                }
            },
                TaskScheduler.FromCurrentSynchronizationContext());
        }
 public PlaylistsPageViewPresenter(
     IApplicationResources resources,
     IPlaylistsService playlistsService,
     INavigationService navigationService,
     IPlayQueueService playQueueService,
     ISongsCachingService cachingService,
     IApplicationStateService stateService)
     : base(resources, playlistsService, navigationService, playQueueService, cachingService, stateService)
 {
 }
 /// <summary>
 /// Initializes a new instance of <see cref="AggregateRootRepository{T}">AggregatedRootRepository</see>
 /// </summary>
 /// <param name="commandContextManager"> <see cref="ICommandContextManager"/> to use for tracking </param>
 /// <param name="eventStore"><see cref="IEventStore"/> for getting <see cref="IEvent">events</see></param>
 /// <param name="eventSourceVersions"><see cref="IEventSourceVersions"/> for working with versioning of <see cref="AggregateRoot"/></param>
 /// <param name="applicationResources"><see cref="IApplicationResources"/> for being able to identify resources</param>
 public AggregateRootRepository(
     ICommandContextManager commandContextManager,
     IEventStore eventStore,
     IEventSourceVersions eventSourceVersions,
     IApplicationResources applicationResources)
 {
     _commandContextManager = commandContextManager;
     _eventStore            = eventStore;
     _eventSourceVersions   = eventSourceVersions;
     _applicationResources  = applicationResources;
 }
Exemple #6
0
        public static void Initialize(
            IMainFrame applicationToolbar,
            IApplicationResources resources,
            IApplicationStateService stateService,
            IEventAggregator eventAggregator)
        {
            eventAggregator.GetEvent <ApplicationStateChangeEvent>().Subscribe(
                (e) => applicationToolbar.SetMenuItems(GetItems(resources, stateService)));

            applicationToolbar.SetMenuItems(GetItems(resources, stateService));
        }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of <see cref="EventEnvelopes"/>
 /// </summary>
 /// <param name="applicationResources"><see cref="IApplicationResources"/> for identifying resources</param>
 /// <param name="systemClock"><see cref="ISystemClock"/> for working with time</param>
 /// <param name="executionContext"><see cref="IExecutionContext"/> for working with metadata related to current execution context</param>
 /// <param name="eventMigrationHierarchyManager"><see cref="IEventMigrationHierarchyManager"/> for working with the migration levels of <see cref="IEvent">events</see></param>
 public EventEnvelopes(
     IApplicationResources applicationResources,
     ISystemClock systemClock,
     IExecutionContext executionContext,
     IEventMigrationHierarchyManager eventMigrationHierarchyManager)
 {
     _applicationResources           = applicationResources;
     _systemClock                    = systemClock;
     _executionContext               = executionContext;
     _eventMigrationHierarchyManager = eventMigrationHierarchyManager;
 }
 public PlaylistPageViewPresenter(
     IDependencyResolverContainer container,
     IApplicationResources resources,
     IUserPlaylistsService userPlaylistsService,
     IPlaylistsService playlistsService)
     : base(container)
 {
     this.resources                 = resources;
     this.userPlaylistsService      = userPlaylistsService;
     this.playlistsService          = playlistsService;
     this.RemoveFromPlaylistCommand = new DelegateCommand(this.RemoveFromPlaylist);
 }
Exemple #9
0
 /// <summary>
 /// Initializes a new instance of <see cref="CommandHandlerInvoker">CommandHandlerInvoker</see>
 /// </summary>
 /// <param name="typeFinder">A <see cref="ITypeFinder"/> to use for discovering <see cref="IHandleCommands">command handlers</see></param>
 /// <param name="container">A <see cref="IContainer"/> to use for getting instances of objects</param>
 /// <param name="applicationResources"><see cref="IApplicationResources"/> for identifying resources</param>
 /// <param name="converter"><see cref="ICommandRequestConverter"/> for converting to actual <see cref="ICommand"/> instances</param>
 public CommandHandlerInvoker(
     ITypeFinder typeFinder,
     IContainer container,
     IApplicationResources applicationResources,
     ICommandRequestConverter converter)
 {
     _typeFinder           = typeFinder;
     _container            = container;
     _applicationResources = applicationResources;
     _converter            = converter;
     _initialized          = false;
 }
        public LinksRegionViewPresenter(
            IApplicationStateService stateService,
            IApplicationResources resources,
            ISearchService searchService,
            IDispatcher dispatcher,
            IGoogleMusicSynchronizationService googleMusicSynchronizationService,
            IApplicationSettingViewsService applicationSettingViewsService,
            IGoogleMusicSessionService sessionService,
            INavigationService navigationService)
        {
            this.stateService = stateService;
            this.resources    = resources;
            this.dispatcher   = dispatcher;
            this.googleMusicSynchronizationService = googleMusicSynchronizationService;
            this.sessionService          = sessionService;
            this.navigationService       = navigationService;
            this.ShowSearchCommand       = new DelegateCommand(searchService.Activate);
            this.NavigateToDownloadQueue = new DelegateCommand(async() =>
            {
                if (!this.disableClickToCache)
                {
                    await this.dispatcher.RunAsync(() => applicationSettingViewsService.Show("offlinecache"));
                }
            });

            this.UpdateLibraryCommand = new DelegateCommand(
                async() =>
            {
                if (this.UpdateLibraryCommand.CanExecute())
                {
                    this.synchronizationTimer.Stop();
                    await this.Synchronize(forceToDownloadPlaylists: true);
                }
            },
                () => !this.BindingModel.ShowProgressRing);

            this.BindingModel = new LinksRegionBindingModel();

            this.synchronizationTimer = new DispatcherTimer {
                Interval = TimeSpan.FromMinutes(5)
            };
            this.synchronizationTimer.Stop();
            this.synchronizationTime = 0;

            this.synchronizationTimer.Tick += this.SynchronizationTimerOnTick;

            this.Logger.LogTask(this.Synchronize());

            this.SetOfflineMessageIfRequired();

            this.sessionService.SessionCleared += this.SessionServiceOnSessionCleared;
        }
Exemple #11
0
 public SearchPageViewPresenter(
     IApplicationResources resources,
     ISongsRepository songsRepository,
     IPlaylistsService playlistsService,
     INavigationService navigationService,
     IUserPlaylistsRepository userPlaylistsRepository)
 {
     this.resources               = resources;
     this.songsRepository         = songsRepository;
     this.playlistsService        = playlistsService;
     this.navigationService       = navigationService;
     this.userPlaylistsRepository = userPlaylistsRepository;
 }
 public PlaylistsService(
     IDependencyResolverContainer container,
     IRadioStationsService radioStationsService,
     IUserPlaylistsService userPlaylistsService,
     IApplicationResources applicationResources,
     ISettingsService settingsService)
 {
     this.container            = container;
     this.radioStationsService = radioStationsService;
     this.userPlaylistsService = userPlaylistsService;
     this.applicationResources = applicationResources;
     this.settingsService      = settingsService;
 }
Exemple #13
0
 public CommandSecurityProxies(
     ITypeFinder typeFinder,
     ICodeGenerator codeGenerator,
     ICommandSecurityManager commandSecurityManager,
     IApplicationResources applicationResources,
     WebConfiguration configuration)
 {
     _typeFinder             = typeFinder;
     _codeGenerator          = codeGenerator;
     _configuration          = configuration;
     _applicationResources   = applicationResources;
     _commandSecurityManager = commandSecurityManager;
 }
        public RightRegionControlService(
            ILogManager logManager,
            IApplicationResources resources,
            IMainFrameRegionProvider regionProvider,
            IApplicationSettingViewsService settingsCommands)
        {
            this.logger           = logManager.CreateLogger("RightRegionControlService");
            this.resources        = resources;
            this.regionProvider   = regionProvider;
            this.settingsCommands = settingsCommands;

            this.UpdateAdControl();
            InAppPurchases.LicenseChanged += this.UpdateAdControl;
        }
        public AuthentificationPopupViewPresenter(
            IApplicationResources resources,
            IGoogleAccountService googleAccountService,
            IAuthentificationService authentificationService)
        {
            this.resources               = resources;
            this.googleAccountService    = googleAccountService;
            this.authentificationService = authentificationService;
            this.BindingModel            = new AuthentificationPageViewBindingModel();

            this.SignInCommand = new DelegateCommand(this.SignIn, () => !this.BindingModel.IsSigningIn);

            this.BindingModel.Subscribe(() => this.BindingModel.IsSigningIn, (sender, args) => this.SignInCommand.RaiseCanExecuteChanged());
        }
 public AuthentificationService(
     IApplicationResources resources,
     ILogManager logManager,
     IGoogleAccountService googleAccountService,
     IGoogleMusicSessionService sessionService,
     IGoogleAccountWebService googleAccountWebService,
     IGoogleMusicWebService googleMusicWebService)
 {
     this.logger                  = logManager.CreateLogger("AuthentificationService");
     this.resources               = resources;
     this.googleAccountService    = googleAccountService;
     this.sessionService          = sessionService;
     this.googleAccountWebService = googleAccountWebService;
     this.googleMusicWebService   = googleMusicWebService;
 }
Exemple #17
0
        /// <summary>
        /// Initializes a new instance of <see cref="ProcessMethodEventProcessors"/>
        /// </summary>
        /// <param name="applicationResources"><see cref="IApplicationResources"/> for identifying <see cref="IEvent">events</see> </param>
        /// <param name="applicationResourcesIdentifierConverter"><see cref="IApplicationResourceIdentifierConverter"/> for converting <see cref="IApplicationResourceIdentifier"/> to and from different formats</param>
        /// <param name="typeFinder"><see cref="ITypeFinder"/> for discovering implementations of <see cref="IProcessEvents"/></param>
        /// <param name="container"><see cref="IContainer"/> for the implementation <see cref="ProcessMethodEventProcessor"/> when acquiring instances of implementations of <see cref="IProcessEvents"/></param>
        /// <param name="systemClock"><see cref="ISystemClock"/> for timing <see cref="IEventProcessors"/></param>
        public ProcessMethodEventProcessors(
            IApplicationResources applicationResources,
            IApplicationResourceIdentifierConverter applicationResourcesIdentifierConverter,
            ITypeFinder typeFinder,
            IContainer container,
            ISystemClock systemClock)
        {
            _applicationResources = applicationResources;
            _applicationResourcesIdentifierConverter = applicationResourcesIdentifierConverter;
            _typeFinder  = typeFinder;
            _container   = container;
            _systemClock = systemClock;

            PopulateEventProcessors();
        }
 /// <summary>
 /// Initializes a new instance of <see cref="EventStore"/>
 /// </summary>
 /// <param name="configuration"><see cref="EventStoreConfiguration"/> to use as configuration</param>
 /// <param name="applicationResources"><see cref="IApplicationResources"/> for working with <see cref="IApplicationResource">application resources</see></param>
 /// <param name="applicationResourceIdentifierConverter"><see cref="IApplicationResourceIdentifierConverter"/> for working with conversion of <see cref="IApplicationResourceIdentifier"/></param>
 /// <param name="applicationResourceResolver"><see cref="IApplicationResourceResolver"/> for resolving <see cref="IApplicationResourceIdentifier"/> to concrete types</param>
 /// <param name="eventEnvelopes"><see cref="IEventEnvelopes"/> for working with <see cref="EventEnvelope"/></param>
 /// <param name="serializer"><see cref="ISerializer"/> to use for serialization</param>
 public EventStore(
     EventStoreConfiguration configuration,
     IApplicationResources applicationResources,
     IApplicationResourceIdentifierConverter applicationResourceIdentifierConverter,
     IApplicationResourceResolver applicationResourceResolver,
     IEventEnvelopes eventEnvelopes,
     ISerializer serializer)
 {
     _configuration        = configuration;
     _eventEnvelopes       = eventEnvelopes;
     _applicationResources = applicationResources;
     _applicationResourceIdentifierConverter = applicationResourceIdentifierConverter;
     _applicationResourceResolver            = applicationResourceResolver;
     _serializer = serializer;
 }
Exemple #19
0
        public CommandProxies(
            IApplicationResources applicationResources,
            IApplicationResourceIdentifierConverter applicationResourceIdentifierConverter,
            ITypeFinder typeFinder,
            IInstancesOf <ICanExtendCommandProperty> commandPropertyExtenders,
            ICodeGenerator codeGenerator,
            WebConfiguration configuration)
        {
            _applicationResources = applicationResources;
            _applicationResourceIdentifierConverter = applicationResourceIdentifierConverter;
            _typeFinder = typeFinder;
            _commandPropertyExtenders = commandPropertyExtenders;
            _codeGenerator            = codeGenerator;

            _configuration = configuration;
        }
Exemple #20
0
        /// <summary>
        /// Initializes a new instance of <see cref="EventStore"/>
        /// </summary>
        /// <param name="applicationResources">System for dealing with <see cref="IApplicationResources">Application Resources</see></param>
        /// <param name="applicationResourceIdentifierConverter"><see cref="IApplicationResourceIdentifierConverter">Converter</see> for converting to and from string representations</param>
        /// <param name="connectionStringProvider"><see cref="ICanProvideConnectionString">ConnectionString provider</see></param>
        public EventStore(
            IApplicationResources applicationResources,
            IApplicationResourceIdentifierConverter applicationResourceIdentifierConverter,
            ICanProvideConnectionString connectionStringProvider)
        {
            _applicationResources = applicationResources;
            _applicationResourceIdentifierConverter = applicationResourceIdentifierConverter;
            var connectionString = connectionStringProvider();

            var account     = CloudStorageAccount.Parse(connectionString);
            var tableClient = account.CreateCloudTableClient();

            _table = tableClient.GetTableReference(EventStoreTable);

            _table.CreateIfNotExistsAsync();
        }
        /// <summary>
        /// Initializes a new instance of <see cref="ProcessMethodEventProcessors"/>
        /// </summary>
        /// <param name="applicationResources"><see cref="IApplicationResources"/> for identifying <see cref="IEvent">events</see> </param>
        /// <param name="applicationResourcesIdentifierConverter"><see cref="IApplicationResourceIdentifierConverter"/> for converting <see cref="IApplicationResourceIdentifier"/> to and from different formats</param>
        /// <param name="typeDiscoverer"><see cref="ITypeDiscoverer"/> for discovering implementations of <see cref="IProcessEvents"/></param>
        /// <param name="container"><see cref="IContainer"/> for the implementation <see cref="ProcessMethodEventProcessor"/> when acquiring instances of implementations of <see cref="IProcessEvents"/></param>
        /// <param name="systemClock"><see cref="ISystemClock"/> for timing <see cref="IEventProcessors"/></param>
        /// <param name="logger"><see cref="ILogger"/> to use for logging</param>
        public ProcessMethodEventProcessors(
            IApplicationResources applicationResources,
            IApplicationResourceIdentifierConverter applicationResourcesIdentifierConverter,
            ITypeDiscoverer typeDiscoverer,
            IContainer container,
            ISystemClock systemClock,
            ILogger logger)
        {
            _applicationResources = applicationResources;
            _applicationResourcesIdentifierConverter = applicationResourcesIdentifierConverter;
            _typeDiscoverer = typeDiscoverer;
            _container      = container;
            _systemClock    = systemClock;
            _logger         = logger;

            PopulateEventProcessors();
        }
Exemple #22
0
 public RadioPageViewPresenter(
     IApplicationResources resources,
     IPlaylistsService playlistsService,
     INavigationService navigationService,
     IPlayQueueService playQueueService,
     ISongsCachingService cachingService,
     IApplicationStateService stateService,
     IRadioWebService radioWebService)
     : base(resources, playlistsService, navigationService, playQueueService, cachingService, stateService)
 {
     this.resources            = resources;
     this.navigationService    = navigationService;
     this.playQueueService     = playQueueService;
     this.radioWebService      = radioWebService;
     this.EditRadioNameCommand = new DelegateCommand(this.EditRadioName, () => this.BindingModel.SelectedItems.Count == 1);
     this.DeleteRadioCommand   = new DelegateCommand(this.DeleteRadio, () => this.BindingModel.SelectedItems.Count > 0);
 }
 public UserPlaylistsPageViewPresenter(
     IApplicationResources resources,
     INavigationService navigationService,
     IPlayQueueService playQueueService,
     IPlaylistsService playlistsService,
     IUserPlaylistsService userPlaylistsService,
     ISongsCachingService cachingService,
     IApplicationStateService stateService)
     : base(resources, playlistsService, navigationService, playQueueService, cachingService, stateService)
 {
     this.resources              = resources;
     this.userPlaylistsService   = userPlaylistsService;
     this.stateService           = stateService;
     this.AddPlaylistCommand     = new DelegateCommand(this.AddPlaylist);
     this.EditPlaylistCommand    = new DelegateCommand(this.EditPlaylist, () => this.BindingModel.SelectedItems.Count == 1);
     this.DeletePlaylistsCommand = new DelegateCommand(this.DeletePlaylists, () => this.BindingModel.SelectedItems.Count > 0);
 }
Exemple #24
0
        public static void Initialize(
            IMainFrame applicationToolbar,
            IApplicationResources resources,
            IApplicationStateService stateService,
            ISettingsService settingsService,
            IEventAggregator eventAggregator)
        {
            eventAggregator.GetEvent <ApplicationStateChangeEvent>().Subscribe(
                (e) => applicationToolbar.SetMenuItems(GetItems(resources, stateService, settingsService)));

            eventAggregator.GetEvent <SettingsChangeEvent>()
            .Where(x => string.Equals(x.Key, GoogleMusicCoreSettingsServiceExtensions.IsAllAccessAvailableKey, StringComparison.OrdinalIgnoreCase))
            .Subscribe(
                (e) => applicationToolbar.SetMenuItems(GetItems(resources, stateService, settingsService)));

            applicationToolbar.SetMenuItems(GetItems(resources, stateService, settingsService));
        }
Exemple #25
0
        internal ProgressLoadingPopupViewPresenter(
            IApplicationResources resources,
            ISettingsService settingsService,
            IInitialSynchronization initialSynchronization)
        {
            this.resources              = resources;
            this.settingsService        = settingsService;
            this.initialSynchronization = initialSynchronization;
            this.BindingModel           = new ProgressLoadingPageViewBindingModel();

            this.ReloadSongsCommand = new DelegateCommand(this.LoadSongs, () => this.BindingModel.IsFailed);

            this.BindingModel.Subscribe(
                () => this.BindingModel.IsFailed, (sender, args) => this.ReloadSongsCommand.RaiseCanExecuteChanged());

            this.LoadSongs();
        }
        internal CurrentPlaylistPageViewPresenter(
            IApplicationResources resources,
            IPlayQueueService playQueueService,
            ISongsService metadataEditService,
            ISongsCachingService cachingService,
            IApplicationStateService stateService,
            INavigationService navigationService,
            IRadioStationsService radioStationsService,
            ISettingsService settingsService,
            SongsBindingModel songsBindingModel)
        {
            this.resources            = resources;
            this.playQueueService     = playQueueService;
            this.metadataEditService  = metadataEditService;
            this.cachingService       = cachingService;
            this.stateService         = stateService;
            this.navigationService    = navigationService;
            this.radioStationsService = radioStationsService;
            this.settingsService      = settingsService;
            this.BindingModel         = songsBindingModel;

            this.playQueueService.QueueChanged += async(sender, args) => await this.Dispatcher.RunAsync(this.UpdateSongs);

            //this.SaveAsPlaylistCommand = new DelegateCommand(this.SaveAsPlaylist, () => this.BindingModel.Songs.Count > 0);
            this.RemoveSelectedSongCommand = new DelegateCommand(this.RemoveSelectedSong, () => this.BindingModel.SelectedItems.Count > 0);
            this.AddToPlaylistCommand      = new DelegateCommand(this.AddToPlaylist, () => this.BindingModel.SelectedItems.Count > 0);
            this.RateSongCommand           = new DelegateCommand(this.RateSong);
            this.DownloadCommand           = new DelegateCommand(this.Download, () => this.BindingModel.SelectedItems.Count(x => !x.Metadata.UnknownSong) > 0);
            this.UnPinCommand      = new DelegateCommand(this.UnPin, () => this.BindingModel.SelectedItems.Count(x => !x.Metadata.UnknownSong) > 0);
            this.StartRadioCommand = new DelegateCommand(this.StartRadio, () => this.BindingModel != null && this.BindingModel.SelectedItems.Count == 1);

            this.playQueueService.StateChanged += async(sender, args) => await this.Dispatcher.RunAsync(async() =>
            {
                if (this.BindingModel.SelectedItems.Count == 0)
                {
                    if (this.BindingModel.Songs != null && args.CurrentSong != null)
                    {
                        var currentSong = this.BindingModel.Songs.FirstOrDefault(x => string.Equals(x.Metadata.SongId, args.CurrentSong.SongId, StringComparison.Ordinal));
                        if (currentSong != null)
                        {
                            await this.View.ScrollIntoCurrentSongAsync(currentSong);
                        }
                    }
                }
            });
        }
Exemple #27
0
        public PlaylistPageViewPresenterBase(IDependencyResolverContainer container)
        {
            this.playQueueService    = container.Resolve <IPlayQueueService>();
            this.metadataEditService = container.Resolve <ISongsService>();
            this.playlistsService    = container.Resolve <IPlaylistsService>();
            this.resources           = container.Resolve <IApplicationResources>();
            this.cachingService      = container.Resolve <ISongsCachingService>();
            this.stateService        = container.Resolve <IApplicationStateService>();
            this.radioWebService     = container.Resolve <IRadioWebService>();
            this.navigationService   = container.Resolve <INavigationService>();

            this.QueueCommand         = new DelegateCommand(this.Queue, () => this.BindingModel != null && this.BindingModel.SongsBindingModel.SelectedItems.Count > 0);
            this.AddToPlaylistCommand = new DelegateCommand(this.AddToPlaylist, () => this.BindingModel != null && this.BindingModel.SongsBindingModel.SelectedItems.Count > 0);
            this.DownloadCommand      = new DelegateCommand(this.Download, () => this.BindingModel != null && this.BindingModel.SongsBindingModel.SelectedItems.Count > 0);
            this.UnPinCommand         = new DelegateCommand(this.UnPin, () => this.BindingModel != null && this.BindingModel.SongsBindingModel.SelectedItems.Count > 0);
            this.RateSongCommand      = new DelegateCommand(this.RateSong);
            this.StartRadioCommand    = new DelegateCommand(this.StartRadio, () => this.BindingModel != null && this.BindingModel.SongsBindingModel.SelectedItems.Count == 1);
        }
        public RadioStationsService(
            IRadioWebService radioWebService,
            IRadioStationsRepository radioStationsRepository,
            ISongsRepository songsRepository,
            INotificationService notificationService,
            IApplicationResources applicationResources,
            IEventAggregator eventAggregator,
            ILogManager logManager)
        {
            this.radioWebService         = radioWebService;
            this.radioStationsRepository = radioStationsRepository;
            this.songsRepository         = songsRepository;
            this.notificationService     = notificationService;
            this.applicationResources    = applicationResources;
            this.eventAggregator         = eventAggregator;

            this.logger = logManager.CreateLogger("RadioStationsService");
        }
 public RadioPageViewPresenter(
     IApplicationResources resources,
     IPlaylistsService playlistsService,
     INavigationService navigationService,
     IPlayQueueService playQueueService,
     ISongsCachingService cachingService,
     IApplicationStateService stateService,
     IRadioStationsService radioStationsService,
     ISettingsService settingsService)
     : base(resources, playlistsService, navigationService, playQueueService, cachingService, stateService, radioStationsService, settingsService)
 {
     this.resources            = resources;
     this.navigationService    = navigationService;
     this.playQueueService     = playQueueService;
     this.radioStationsService = radioStationsService;
     this.EditRadioNameCommand = new DelegateCommand(this.EditRadioName, () => this.BindingModel.SelectedItems.Count == 1);
     this.DeleteRadioCommand   = new DelegateCommand(this.DeleteRadio, () => this.BindingModel.SelectedItems.Count > 0 && this.BindingModel.SelectedItems.All(x => !string.IsNullOrEmpty(x.Playlist.Id)));
 }
Exemple #30
0
 /// <summary>
 /// Initializes a new instance of <see cref="EventStore"/>
 /// </summary>
 /// <param name="configuration"><see cref="EventStoreConfiguration"/> to use as configuration</param>
 /// <param name="applicationResources"><see cref="IApplicationResources"/> for working with <see cref="IApplicationResource">application resources</see></param>
 /// <param name="applicationResourceIdentifierConverter"><see cref="IApplicationResourceIdentifierConverter"/> for working with conversion of <see cref="IApplicationResourceIdentifier"/></param>
 /// <param name="applicationResourceResolver"><see cref="IApplicationResourceResolver"/> for resolving <see cref="IApplicationResourceIdentifier"/> to concrete types</param>
 /// <param name="eventEnvelopes"><see cref="IEventEnvelopes"/> for working with <see cref="EventEnvelope"/></param>
 /// <param name="serializer"><see cref="ISerializer"/> to use for serialization</param>
 /// <param name="files"><see cref="IFiles"/> to work with files</param>
 /// <param name="logger"><see cref="ILogger"/> for logging</param>
 public EventStore(
     EventStoreConfiguration configuration,
     IApplicationResources applicationResources,
     IApplicationResourceIdentifierConverter applicationResourceIdentifierConverter,
     IApplicationResourceResolver applicationResourceResolver,
     IEventEnvelopes eventEnvelopes,
     ISerializer serializer,
     IFiles files,
     ILogger logger)
 {
     logger.Information($"Using path : {configuration.Path}");
     _configuration        = configuration;
     _eventEnvelopes       = eventEnvelopes;
     _applicationResources = applicationResources;
     _applicationResourceIdentifierConverter = applicationResourceIdentifierConverter;
     _applicationResourceResolver            = applicationResourceResolver;
     _serializer = serializer;
     _files      = files;
 }
 public ParentAssociation(IApplicationResources resources, ITrivialFilter trivialFilter, IModelBuilder modelFactory)
     : base(resources, trivialFilter)
 {
     this.modelBuilder = modelFactory;
 }
 public TestAssociation(IApplicationResources stubApplicationResources, ITrivialFilter filter, VisualisableType associatedTo)
     : base(stubApplicationResources, filter)
 {
     AssociatedTo = associatedTo;
 }
Exemple #33
0
 protected Association(IApplicationResources resources, ITrivialFilter trivialFilter)
 {
     this.ApplicationResources = resources;
     this.trivialFilter = trivialFilter;
 }
 public void TestInitialise()
 {
     this.mockType = MockRepository.GenerateStub<IVisualisableTypeWithAssociations>();
     this.mockModelBuilder = MockRepository.GenerateMock<IModelBuilder>();
     this.mockResources = MockRepository.GenerateStub<IApplicationResources>();
     this.mockType.Expect(m => m.Name).Return("1234567890");
     this.mockType.Expect(m => m.Modifiers).Return(new ModifiersData(typeof (string)));
 }
 public void TestCleanUp()
 {
     this.mockResources = null;
     this.mockType = null;
 }
        private IDiagramDimensions dimensions; // Need to set this in testing

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="FieldAssociation"/> class. 
        /// Only actual instances of <see cref="FieldAssociation"/> use this constructor. Sub-classes use the other.
        /// </summary>
        /// <param name="resources">
        /// The application resources.
        /// </param>
        /// <param name="trivialFilter">
        /// The trivial filter to use to determine the kind of relationship. Used for styling decisions.
        /// </param>
        /// <param name="modelBuilder">
        /// The model Builder to be used when constructing the related <see cref="IVisualisableType"/> from the given type in <see cref="Initialise"/>.
        /// </param>
        /// <param name="diagramDimensions">
        /// The diagram Dimensions.
        /// </param>
        public FieldAssociation(IApplicationResources resources, ITrivialFilter trivialFilter, IModelBuilder modelBuilder, IDiagramDimensions diagramDimensions)
            : base(resources, trivialFilter)
        {
            this.dimensions = diagramDimensions;
            this.modelBuilder = modelBuilder;
        }
 public StaticAssociation(IApplicationResources resources, ITrivialFilter trivialFilter, IModelBuilder modelBuilder, IDiagramDimensions diagramDimensions)
     : base(resources, trivialFilter, modelBuilder, diagramDimensions)
 {
 }
 public SubjectAssociation(IApplicationResources resources, ITrivialFilter trivialFilter)
     : base(resources, trivialFilter)
 {
 }