Esempio n. 1
0
 private static void RegisterNewFileEnumeration(LaunchFromShellHelper helper)
 {
     if (_currentShellCommand != null)
     {
         _currentShellCommand.Cancel();
     }
     _currentShellCommand = helper;
     _currentShellCommand.Go(new DeferredInvokeHandler(DataObjectEnumerationComplete));
 }
Esempio n. 2
0
        private static void DataObjectEnumerationComplete(object args)
        {
            if (args != _currentShellCommand)
            {
                return;
            }
            string taskName = _currentShellCommand.TaskName;

            if (taskName == "play" || taskName == "playasplaylist")
            {
                List <FileEntry> files     = _currentShellCommand.Files;
                MediaType        mediaType = FilterFiles(files);
                if (files != null && files.Count > 0 && (mediaType == MediaType.Track || mediaType == MediaType.Video))
                {
                    PlaybackContext playbackContext = PlaybackContext.Music;
                    if (mediaType == MediaType.Video)
                    {
                        playbackContext = PlaybackContext.LibraryVideo;
                    }
                    SingletonModelItem <TransportControls> .Instance.PlayItems(files, playbackContext);
                }
            }
            _currentShellCommand = null;
        }