Ejemplo n.º 1
0
        private void ShowMediaPaneSelectedFile(RlFileItemViewModel fileItemVm)
        {
            _eventAggregator.GetEvent <SetMediaFileRlEvent>().Publish("");

            if (!fileItemVm.IsDirectory)
            {
                SelectedFolder = Path.GetDirectoryName(fileItemVm.FullPath);
                //Get file extension
                var ext = Path.GetExtension(fileItemVm.FullPath);

                //Show the bezel editor if its a bezel file
                if (fileItemVm.DisplayName.ToLower().Contains("bezel") && ext.ToLower() == ".png")
                {
                    if (RlStaticMethods.GetMediaFormatFromFile(fileItemVm.FullPath) == "image")
                    {
                        _eventAggregator.GetEvent <NavigateMediaPaneRequestEvent>().Publish("BezelEditView");
                    }

                    _eventAggregator.GetEvent <SetBezelImagesEvent>().Publish(fileItemVm.FullPath);
                }
                else
                {
                    _eventAggregator.GetEvent <NavigateMediaPaneRequestEvent>().Publish("MediaPaneView");

                    _eventAggregator.GetEvent <SetMediaFileRlEvent>().Publish(fileItemVm.FullPath);
                }
            }
            else
            {
                SelectedFolder = fileItemVm.FullPath;
            }
        }
Ejemplo n.º 2
0
        private void UpdateRlFolders(string systemName, string romname, string mediatype)
        {
            SelectedFolder = RlStaticMethods.GetSelectedPath(_settings.HypermintSettings.RlMediaPath, mediatype, systemName, romname);

            if (!Directory.Exists(SelectedFolder))
            {
                return;
            }

            var rlRootFolderItem = new RlFileItemViewModel(SelectedFolder, true);

            var dirs = Directory.EnumerateDirectories(SelectedFolder, "*", SearchOption.AllDirectories);

            foreach (var dir in dirs)
            {
                var rlFolderItem = new RlFileItemViewModel(dir, true);

                var files = Directory.EnumerateFiles(dir);
                foreach (var file in files)
                {
                    rlFolderItem.Children.Add(new RlFileItemViewModel(file));
                }

                rlRootFolderItem.Children.Add(rlFolderItem);
            }

            var rootFiles = Directory.EnumerateFiles(SelectedFolder);

            foreach (var file in rootFiles)
            {
                rlRootFolderItem.Children.Add(new RlFileItemViewModel(file));
            }

            RlFiles.Add(rlRootFolderItem);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Files selection changed.
 /// </summary>
 /// <param name="fileItemVm">The file item vm.</param>
 private void FilesSelectionChanged(RlFileItemViewModel fileItemVm)
 {
     ShowMediaPaneSelectedFile(fileItemVm);
 }