Restart process

This commit is contained in:
Holger Börchers 2020-05-14 19:35:58 +02:00
parent ad1e92362d
commit 96e90f8693
24 changed files with 43 additions and 1549 deletions

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="ExifLibNet" Version="2.1.1" /> <PackageReference Include="ExifLibNet" Version="2.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8"> <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

View File

@ -1,30 +0,0 @@
using System;
using PhotoRenamer.Base;
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<ViewA>();
_regionManager.RequestNavigate(RegionNames.ContentRegion, new Uri(nameof(ViewA), UriKind.Relative));
}
}
}

View File

@ -1,19 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>latest</LangVersion>
<UseWPF>true</UseWPF>
<AssemblyName>PhotoRenamer.File</AssemblyName>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Prism.Wpf" Version="7.2.0.1422" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PhotoRenamer.Base\PhotoRenamer.Base.csproj" />
</ItemGroup>
</Project>

View File

@ -1,14 +0,0 @@
using Prism.Mvvm;
using System.Windows.Input;
using JetBrains.Annotations;
namespace PhotoRenamer.File.ViewModels
{
[UsedImplicitly]
public class ViewAViewModel : BindableBase
{
public ICommand SelectFilesCommand { get; }
public ICommand ClearCommand { get; }
}
}

View File

@ -1,41 +0,0 @@
<UserControl
x:Class="PhotoRenamer.File.Views.ViewA"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:prism="http://prismlibrary.com/"
xmlns:viewModels="clr-namespace:PhotoRenamer.File.ViewModels"
d:DataContext="{d:DesignInstance viewModels:ViewAViewModel}"
d:DesignHeight="300"
d:DesignWidth="300"
prism:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d">
<DockPanel>
<ToolBarTray DockPanel.Dock="Top" Orientation="Horizontal">
<ToolBar ToolBarTray.IsLocked="True">
<Button Command="{Binding SelectFilesCommand}" Content="Select Files" />
<Button Command="{Binding ClearCommand}" Content="Clear" />
</ToolBar>
</ToolBarTray>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<GroupBox
Grid.Row="0"
Margin="5"
Header="Source">
<ListView />
</GroupBox>
<GroupBox
Grid.Row="2"
Margin="5"
Header="Target">
<ListView />
</GroupBox>
</Grid>
</DockPanel>
</UserControl>

View File

@ -1,13 +0,0 @@
namespace PhotoRenamer.File.Views
{
/// <summary>
/// Interaction logic for ViewA.xaml
/// </summary>
public partial class ViewA
{
public ViewA()
{
InitializeComponent();
}
}
}

View File

@ -1,30 +0,0 @@
using System;
using PhotoRenamer.Base;
using PhotoRenamer.Logging.Views;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
namespace PhotoRenamer.Logging
{
public class LoggingModule : IModule
{
private readonly IRegionManager _regionManager;
public LoggingModule(IRegionManager regionManager)
{
_regionManager = regionManager;
}
public void OnInitialized(IContainerProvider containerProvider)
{
}
public void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterForNavigation<ViewA>();
_regionManager.RequestNavigate(RegionNames.LoggingRegion, new Uri(nameof(ViewA), UriKind.Relative));
}
}
}

View File

@ -1,19 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>latest</LangVersion>
<UseWPF>true</UseWPF>
<AssemblyName>PhotoRenamer.Logging</AssemblyName>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Prism.Wpf" Version="7.2.0.1422" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PhotoRenamer.Base\PhotoRenamer.Base.csproj" />
</ItemGroup>
</Project>

View File

@ -1,14 +0,0 @@
using System.Windows.Input;
using JetBrains.Annotations;
using Prism.Mvvm;
namespace PhotoRenamer.Logging.ViewModels
{
[UsedImplicitly]
public class ViewAViewModel : BindableBase
{
public ICommand SelectFilesCommand { get; }
public ICommand ClearCommand { get; }
}
}

View File

@ -1,17 +0,0 @@
<UserControl
x:Class="PhotoRenamer.Logging.Views.ViewA"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:prism="http://prismlibrary.com/"
xmlns:viewModels="clr-namespace:PhotoRenamer.Logging.ViewModels"
d:DataContext="{d:DesignInstance viewModels:ViewAViewModel}"
d:DesignHeight="300"
d:DesignWidth="300"
prism:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d">
<GroupBox Margin="5" Header="Log">
<ListView />
</GroupBox>
</UserControl>

View File

@ -1,13 +0,0 @@
namespace PhotoRenamer.Logging.Views
{
/// <summary>
/// Interaction logic for ViewA.xaml
/// </summary>
public partial class ViewA
{
public ViewA()
{
InitializeComponent();
}
}
}

View File

@ -2,8 +2,7 @@ using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using PhotoRenamer.Base; using PhotoRenamer.Types;
using PhotoRenamer.Base.Types;
namespace PhotoRenamer.Test namespace PhotoRenamer.Test
{ {

View File

@ -7,14 +7,14 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8"> <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.0.0" /> <PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="2.0.0" /> <PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
<PackageReference Include="coverlet.collector" Version="1.2.0"> <PackageReference Include="coverlet.collector" Version="1.2.1">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
@ -40,6 +40,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\PhotoRenamer.Base\PhotoRenamer.Base.csproj" /> <ProjectReference Include="..\PhotoRenamer.Base\PhotoRenamer.Base.csproj" />
<ProjectReference Include="..\PhotoRenamer\PhotoRenamer.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -5,14 +5,10 @@ VisualStudioVersion = 16.0.29609.76
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PhotoRenamer", "PhotoRenamer\PhotoRenamer.csproj", "{C2C8C238-CB3D-4DDA-96FC-297D029F6022}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PhotoRenamer", "PhotoRenamer\PhotoRenamer.csproj", "{C2C8C238-CB3D-4DDA-96FC-297D029F6022}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhotoRenamer.File", "PhotoRenamer.File\PhotoRenamer.File.csproj", "{185069C2-C1EB-4116-8C33-952A2C0BA1F9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhotoRenamer.Test", "PhotoRenamer.Test\PhotoRenamer.Test.csproj", "{07F827BC-CF99-4E81-A5C7-54085C97FC10}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhotoRenamer.Test", "PhotoRenamer.Test\PhotoRenamer.Test.csproj", "{07F827BC-CF99-4E81-A5C7-54085C97FC10}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhotoRenamer.Base", "PhotoRenamer.Base\PhotoRenamer.Base.csproj", "{DE85C395-3D50-4C12-9B7A-021180E26CE1}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhotoRenamer.Base", "PhotoRenamer.Base\PhotoRenamer.Base.csproj", "{DE85C395-3D50-4C12-9B7A-021180E26CE1}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhotoRenamer.Logging", "PhotoRenamer.Logging\PhotoRenamer.Logging.csproj", "{1AB0E84A-BEEA-4AAA-96BC-D0D66AC63E11}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -23,10 +19,6 @@ Global
{C2C8C238-CB3D-4DDA-96FC-297D029F6022}.Debug|Any CPU.Build.0 = Debug|Any CPU {C2C8C238-CB3D-4DDA-96FC-297D029F6022}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2C8C238-CB3D-4DDA-96FC-297D029F6022}.Release|Any CPU.ActiveCfg = Release|Any CPU {C2C8C238-CB3D-4DDA-96FC-297D029F6022}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2C8C238-CB3D-4DDA-96FC-297D029F6022}.Release|Any CPU.Build.0 = Release|Any CPU {C2C8C238-CB3D-4DDA-96FC-297D029F6022}.Release|Any CPU.Build.0 = Release|Any CPU
{185069C2-C1EB-4116-8C33-952A2C0BA1F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{185069C2-C1EB-4116-8C33-952A2C0BA1F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{185069C2-C1EB-4116-8C33-952A2C0BA1F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{185069C2-C1EB-4116-8C33-952A2C0BA1F9}.Release|Any CPU.Build.0 = Release|Any CPU
{07F827BC-CF99-4E81-A5C7-54085C97FC10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {07F827BC-CF99-4E81-A5C7-54085C97FC10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{07F827BC-CF99-4E81-A5C7-54085C97FC10}.Debug|Any CPU.Build.0 = Debug|Any CPU {07F827BC-CF99-4E81-A5C7-54085C97FC10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07F827BC-CF99-4E81-A5C7-54085C97FC10}.Release|Any CPU.ActiveCfg = Release|Any CPU {07F827BC-CF99-4E81-A5C7-54085C97FC10}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -35,10 +27,6 @@ Global
{DE85C395-3D50-4C12-9B7A-021180E26CE1}.Debug|Any CPU.Build.0 = Debug|Any CPU {DE85C395-3D50-4C12-9B7A-021180E26CE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE85C395-3D50-4C12-9B7A-021180E26CE1}.Release|Any CPU.ActiveCfg = Release|Any CPU {DE85C395-3D50-4C12-9B7A-021180E26CE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE85C395-3D50-4C12-9B7A-021180E26CE1}.Release|Any CPU.Build.0 = Release|Any CPU {DE85C395-3D50-4C12-9B7A-021180E26CE1}.Release|Any CPU.Build.0 = Release|Any CPU
{1AB0E84A-BEEA-4AAA-96BC-D0D66AC63E11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1AB0E84A-BEEA-4AAA-96BC-D0D66AC63E11}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1AB0E84A-BEEA-4AAA-96BC-D0D66AC63E11}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1AB0E84A-BEEA-4AAA-96BC-D0D66AC63E11}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -1,7 +0,0 @@
<prism:PrismApplication
x:Class="PhotoRenamer.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:prism="http://prismlibrary.com/">
<Application.Resources />
</prism:PrismApplication>

View File

@ -1,32 +0,0 @@
using Prism.Ioc;
using PhotoRenamer.Views;
using System.Windows;
using PhotoRenamer.File;
using PhotoRenamer.Logging;
using Prism.Modularity;
namespace PhotoRenamer
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App
{
protected override Window CreateShell()
{
return Container.Resolve<MainWindow>();
}
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
}
protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
{
moduleCatalog.AddModule<FileModule>();
moduleCatalog.AddModule<LoggingModule>();
base.ConfigureModuleCatalog(moduleCatalog);
}
}
}

View File

@ -2,10 +2,9 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using ExifLibrary; using ExifLibrary;
using JetBrains.Annotations; using PhotoRenamer.Types;
using PhotoRenamer.Base.Types;
namespace PhotoRenamer.Base namespace PhotoRenamer
{ {
public static class FilesHelper public static class FilesHelper
{ {

View File

@ -1,28 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>latest</LangVersion>
<UseWPF>true</UseWPF>
<AssemblyName>PhotoRenamer</AssemblyName>
<StartupObject>PhotoRenamer.App</StartupObject>
<PublishTrimmed>true</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishSingleFile>false</PublishSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8"> <PackageReference Include="ExifLibNet" Version="2.1.1" />
<PrivateAssets>all</PrivateAssets> <PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.4" />
</PackageReference> <PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="3.1.4" />
<PackageReference Include="Prism.DryIoc" Version="7.2.0.1422" /> <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.4" />
</ItemGroup> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.4" />
<ItemGroup> <PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.4" />
<ProjectReference Include="..\PhotoRenamer.Base\PhotoRenamer.Base.csproj" />
<ProjectReference Include="..\PhotoRenamer.File\PhotoRenamer.File.csproj" />
<ProjectReference Include="..\PhotoRenamer.Logging\PhotoRenamer.Logging.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

19
PhotoRenamer/Program.cs Normal file
View File

@ -0,0 +1,19 @@
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
namespace PhotoRenamer
{
class Program
{
private static async Task Main(string[] args)
{
var Configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile(AppDomain.CurrentDomain.BaseDirectory + "\\appsettings.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();
}
}
}

View File

@ -1,6 +1,6 @@
using System; using System;
namespace PhotoRenamer.Base.Types namespace PhotoRenamer.Types
{ {
public class MediaFile public class MediaFile
{ {

View File

@ -1,16 +0,0 @@
using JetBrains.Annotations;
using Prism.Mvvm;
namespace PhotoRenamer.ViewModels
{
[UsedImplicitly]
public class MainWindowViewModel : BindableBase
{
private string _title = "Prism Application";
public string Title
{
get => _title;
set => SetProperty(ref _title, value);
}
}
}

View File

@ -1,24 +0,0 @@
<Window
x:Class="PhotoRenamer.Views.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:base="clr-namespace:PhotoRenamer.Base;assembly=PhotoRenamer.Base"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:prism="http://prismlibrary.com/"
xmlns:viewModels="clr-namespace:PhotoRenamer.ViewModels"
Title="{Binding Title}"
Width="1000"
Height="800"
d:DataContext="{d:DesignInstance viewModels:MainWindowViewModel}"
prism:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ContentControl prism:RegionManager.RegionName="{x:Static base:RegionNames.ContentRegion}" />
<ContentControl Grid.Column="1" prism:RegionManager.RegionName="{x:Static base:RegionNames.LoggingRegion}" />
</Grid>
</Window>

View File

@ -1,13 +0,0 @@
namespace PhotoRenamer.Views
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
}
}
}