diff --git a/PhotoRenamer.Base/FilesHelper.cs b/PhotoRenamer.Base/FilesHelper.cs new file mode 100644 index 0000000..1f8c161 --- /dev/null +++ b/PhotoRenamer.Base/FilesHelper.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.IO; + +namespace PhotoRenamer.Base +{ + + public static class FilesHelper + { + private static readonly string[] SupportedFileExtensions = {".jpg", ".cr2", ".mp4"}; + + public static IEnumerable FindSupportedFilesRecursively(string path) + { + var files = Directory.EnumerateFiles(path, "*", SearchOption.AllDirectories); + foreach (var file in files) + { + var fileExt = Path.GetExtension(file); + if(fileExt == null) continue; + foreach (var supportedFileExtension in SupportedFileExtensions) + { + if (fileExt.Equals(supportedFileExtension, StringComparison.InvariantCultureIgnoreCase)) yield return file; + } + } + } + } +} diff --git a/PhotoRenamer.Base/PhotoRenamer.Base.csproj b/PhotoRenamer.Base/PhotoRenamer.Base.csproj new file mode 100644 index 0000000..2147e79 --- /dev/null +++ b/PhotoRenamer.Base/PhotoRenamer.Base.csproj @@ -0,0 +1,15 @@ + + + + netstandard2.0 + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/PhotoRenamer.File/FileModule.cs b/PhotoRenamer.File/FileModule.cs new file mode 100644 index 0000000..2d821bc --- /dev/null +++ b/PhotoRenamer.File/FileModule.cs @@ -0,0 +1,29 @@ +using System; +using PhotoRenamer.File.Views; +using Prism.Ioc; +using Prism.Modularity; +using Prism.Regions; + +namespace PhotoRenamer.File +{ + public class FileModule : IModule + { + private readonly IRegionManager _regionManager; + + public FileModule(IRegionManager regionManager) + { + _regionManager = regionManager; + } + + public void OnInitialized(IContainerProvider containerProvider) + { + + } + + public void RegisterTypes(IContainerRegistry containerRegistry) + { + containerRegistry.RegisterForNavigation(); + _regionManager.RequestNavigate("ContentRegion", new Uri(nameof(ViewA), UriKind.Relative)); + } + } +} \ No newline at end of file diff --git a/PhotoRenamer.File/PhotoRenamer.File.csproj b/PhotoRenamer.File/PhotoRenamer.File.csproj new file mode 100644 index 0000000..d3bf57f --- /dev/null +++ b/PhotoRenamer.File/PhotoRenamer.File.csproj @@ -0,0 +1,14 @@ + + + netcoreapp3.0 + true + PhotoRenamer.File + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + \ No newline at end of file diff --git a/PhotoRenamer.File/ViewModels/ViewAViewModel.cs b/PhotoRenamer.File/ViewModels/ViewAViewModel.cs new file mode 100644 index 0000000..8a9ddee --- /dev/null +++ b/PhotoRenamer.File/ViewModels/ViewAViewModel.cs @@ -0,0 +1,12 @@ +using Prism.Mvvm; +using System.Windows.Input; + +namespace PhotoRenamer.File.ViewModels +{ + public class ViewAViewModel : BindableBase + { + public ICommand SelectFilesCommand { get; } + + public ICommand ClearCommand { get; } + } +} diff --git a/PhotoRenamer.File/Views/ViewA.xaml b/PhotoRenamer.File/Views/ViewA.xaml new file mode 100644 index 0000000..d5ae3f8 --- /dev/null +++ b/PhotoRenamer.File/Views/ViewA.xaml @@ -0,0 +1,41 @@ + + + + +