private void SelectProjectFolder()
 {
     if (_selectDirectoryService.DetermineDirectory())
     {
         ProjectFileLocation = _selectDirectoryService.DirectoryName;
     }
 }
Пример #2
0
        public ListViewModel(IMainWindow mainWindow, ISelectDirectoryService selectDirectoryService)
        {
            _mainWindow = mainWindow;

            _appFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + @"\KidsPlayer\";
            _filePath  = _appFolder + "moviesList.xml";

            LoadMoviesList();

            if (Movies == null || !Movies.Any())
            {
                if (selectDirectoryService.DetermineDirectory())
                {
                    Movies = Directory.EnumerateFiles(selectDirectoryService.DirectoryName, "*.mp4")
                             .Select(file => new Movie {
                        Path = file
                    })
                             .ToList();

                    //var ffMpeg = new FFMpegConverter();
                    //Directory.CreateDirectory(_appFolder + "thumbnails");

                    //foreach (var movie in Movies)
                    //{
                    //    ffMpeg.GetVideoThumbnail(movie.Path, _appFolder + @"thumbnails\" + movie.Name + ".jpg", 50);
                    //}
                }
            }
        }
Пример #3
0
        public ListViewModel(IMainWindow mainWindow, ISelectDirectoryService selectDirectoryService)
        {
            _mainWindow = mainWindow;
            
            _appFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + @"\KidsPlayer\";
            _filePath = _appFolder + "moviesList.xml";

            LoadMoviesList();

            if (Movies == null || !Movies.Any())
            {
                if (selectDirectoryService.DetermineDirectory())
                {
                    Movies = Directory.EnumerateFiles(selectDirectoryService.DirectoryName, "*.mp4")
                        .Select(file => new Movie { Path = file })
                        .ToList();

                    //var ffMpeg = new FFMpegConverter();
                    //Directory.CreateDirectory(_appFolder + "thumbnails");

                    //foreach (var movie in Movies)
                    //{
                    //    ffMpeg.GetVideoThumbnail(movie.Path, _appFolder + @"thumbnails\" + movie.Name + ".jpg", 50);
                    //}
                   

                }
            }
        }
Пример #4
0
 /// <summary>
 /// Method to invoke when the OpenProject command is executed.
 /// </summary>
 private async void OnOpenProjectExecute()
 {
     if (_selectDirectoryService.DetermineDirectory())
     {
         await _messageService.ShowAsync("You have chosen " + _selectDirectoryService.DirectoryName);
     }
 }
        /// <summary>
        /// Method to invoke when the SelectSolutionDirectory command is executed.
        /// </summary>
        private void OnSelectSolutionDirectoryExecute()
        {
            if (_selectDirectoryService.DetermineDirectory())
            {
                RootPath = _selectDirectoryService.DirectoryName;

                Log.Info("Changed solution directory to '{0}'", RootPath);
            }
        }
Пример #6
0
 private void OnBrowseToFunanidbExecute()
 {
     _selectDirectoryService.Title = "Browse to a valid Funani DB or empty directory";
     _selectDirectoryService.ShowNewFolderButton = true;
     if (_selectDirectoryService.DetermineDirectory())
     {
         var di = new DirectoryInfo(_selectDirectoryService.DirectoryName);
         Settings.LastFunaniDatabase = di.FullName;
         Settings.Save();
     }
 }
        /// <summary>
        /// Method to invoke when the SelectOutputDirectory command is executed.
        /// </summary>
        private void OnSelectDirectoryExecute()
        {
            if (!string.IsNullOrEmpty(SelectedDirectory))
            {
                _selectDirectoryService.InitialDirectory = Path.GetFullPath(SelectedDirectory);
            }

            if (_selectDirectoryService.DetermineDirectory())
            {
                SelectedDirectory = _selectDirectoryService.DirectoryName;
            }
        }
        private async void OnAddFolderExecute()
        {
            var rootAppDataDir = _appDataService.GetRootAppDataFolder();

            _selectDirectoryService.Title            = "Select FolderNode's application data folder";
            _selectDirectoryService.InitialDirectory = rootAppDataDir;

            if (_selectDirectoryService.DetermineDirectory())
            {
                var folder = _selectDirectoryService.DirectoryName;

                if (FileBrowser.RootDirectories.Any(x => string.Equals(x.FullName, folder)))
                {
                    await _messageService.ShowError(string.Format("The directory {0} is already added", folder));

                    return;
                }

                _fileBrowserConfigurationService.AddFolder(folder);
            }
        }