コード例 #1
0
        public void Shutdown()
        {
            // Call this method before the player is stopped. It ensures that the App stays alive until the playing file is saved as well.
            MusicPropertiesController.Shutdown();

            TranscodingController.Shutdown();
            PlaylistController.Shutdown();
            PlayerController.Shutdown();
            ManagerController.Shutdown();

            SaveSettings(appSettingsFileName, appSettings);
            SaveSettings(playlistSettingsFileName, playlistSettings);
        }
コード例 #2
0
        public void Initialize()
        {
            appSettings      = LoadSettings <AppSettings>(appSettingsFileName);
            playlistSettings = LoadSettings <PlaylistSettings>(playlistSettingsFileName);

            ShellService.Settings        = appSettings;
            ShellService.ShowErrorAction = ShellViewModel.ShowError;
            ShellService.ShowMusicPropertiesViewAction = ShowMusicPropertiesView;
            ShellService.ShowPlaylistViewAction        = ShowPlaylistView;
            ShellService.ShowTranscodingListViewAction = ShowTranscodingListView;

            ManagerController.Initialize();
            MusicPropertiesController.PlaylistManager = playlistManager;
            MusicPropertiesController.Initialize();
            PlayerController.PlaylistManager  = playlistManager;
            PlayerController.PlaylistSettings = playlistSettings;
            PlayerController.Initialize();
            PlaylistController.PlaylistSettings = playlistSettings;
            PlaylistController.PlaylistManager  = playlistManager;
            PlaylistController.Initialize();
            TranscodingController.Initialize();
        }
コード例 #3
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            musicFileContext = Container.GetExportedValue<MockMusicFileContext>();
            musicFiles = new ObservableCollection<MusicFile>()
            {
               musicFileContext.Create(@"C:\Users\Public\Music\Dancefloor\Culture Beat - Serenity.wav"),
               musicFileContext.Create(@"C:\Culture Beat - Serenity - Epilog.wma"),
            };
            selectionService = Container.GetExportedValue<SelectionService>();
            selectionService.Initialize(musicFiles);

            playlistManager = new PlaylistManager();
            controller = Container.GetExportedValue<PlaylistController>();
            controller.PlaylistSettings = new PlaylistSettings();
            controller.PlaylistManager = playlistManager;
            controller.Initialize();
            controller.Run();

            shellService = Container.GetExportedValue<ShellService>();
            var view = shellService.PlaylistView;
            viewModel = ViewHelper.GetViewModel<PlaylistViewModel>((IView)view);
        }