diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index d5e51e2..424d0e8 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -16,13 +16,24 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.x + dotnet-version: 7.0.x + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1.1 + with: + vs-prerelease: true + - name: Decrypt PFX File + run: | + echo "${{ secrets.WINDOWS_PFX_FILE }}" > cert.pfx.asc + certutil -decode cert.pfx.asc cert.pfx + - name: Add Cert to Store + run: certutil -user -q -p ${{ secrets.WINDOWS_PFX_PASSWORD }} -importpfx cert.pfx NoRoot + - name: Install MAUI Workloads + run: | + dotnet workload install maui --ignore-failed-sources - name: Restore dependencies run: dotnet restore - - name: Build - run: dotnet build --no-restore - - name: Test - run: dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true -o ./publish + - name: Publish + run: dotnet publish -f net7.0-windows10.0.19041.0 -c Release /p:RuntimeIdentifierOverride=win10-x64 /p:GenerateAppxPackageOnBuild=true /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="${{ secrets.WINDOWS_PFX_THUMBPRINT }}" -o publish - name: Create Archive run: powershell Compress-Archive -Path ./publish/* -DestinationPath ./StudentFileRename.zip - name: Upload a Build Artifact diff --git a/StudentFileRename.sln b/StudentFileRename.sln index 1b2be8d..7c75c96 100644 --- a/StudentFileRename.sln +++ b/StudentFileRename.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30611.23 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31611.283 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StudentFileRename", "StudentFileRename\StudentFileRename.csproj", "{170C05E7-034C-409B-9A05-6C27E38AFC03}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StudentFileRename", "StudentFileRename\StudentFileRename.csproj", "{07902AE7-9819-4034-85DE-5A5B2E19DA06}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,31 +11,17 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {03B84C34-9812-4724-91E3-668691721AC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {03B84C34-9812-4724-91E3-668691721AC4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {03B84C34-9812-4724-91E3-668691721AC4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {03B84C34-9812-4724-91E3-668691721AC4}.Release|Any CPU.Build.0 = Release|Any CPU - {B997F407-C7D4-4537-B100-BFA989A0B952}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B997F407-C7D4-4537-B100-BFA989A0B952}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B997F407-C7D4-4537-B100-BFA989A0B952}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B997F407-C7D4-4537-B100-BFA989A0B952}.Release|Any CPU.Build.0 = Release|Any CPU - {0402661D-D955-4902-8CE4-4F5F286F5228}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0402661D-D955-4902-8CE4-4F5F286F5228}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0402661D-D955-4902-8CE4-4F5F286F5228}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0402661D-D955-4902-8CE4-4F5F286F5228}.Release|Any CPU.Build.0 = Release|Any CPU - {170C05E7-034C-409B-9A05-6C27E38AFC03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {170C05E7-034C-409B-9A05-6C27E38AFC03}.Debug|Any CPU.Build.0 = Debug|Any CPU - {170C05E7-034C-409B-9A05-6C27E38AFC03}.Release|Any CPU.ActiveCfg = Release|Any CPU - {170C05E7-034C-409B-9A05-6C27E38AFC03}.Release|Any CPU.Build.0 = Release|Any CPU - {B1025947-8153-44AD-9AB7-515812A291D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B1025947-8153-44AD-9AB7-515812A291D5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B1025947-8153-44AD-9AB7-515812A291D5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B1025947-8153-44AD-9AB7-515812A291D5}.Release|Any CPU.Build.0 = Release|Any CPU + {07902AE7-9819-4034-85DE-5A5B2E19DA06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {07902AE7-9819-4034-85DE-5A5B2E19DA06}.Debug|Any CPU.Build.0 = Debug|Any CPU + {07902AE7-9819-4034-85DE-5A5B2E19DA06}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {07902AE7-9819-4034-85DE-5A5B2E19DA06}.Release|Any CPU.ActiveCfg = Release|Any CPU + {07902AE7-9819-4034-85DE-5A5B2E19DA06}.Release|Any CPU.Build.0 = Release|Any CPU + {07902AE7-9819-4034-85DE-5A5B2E19DA06}.Release|Any CPU.Deploy.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {10CB4309-A38C-4812-934F-C1F0DA4DD488} + SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} EndGlobalSection EndGlobal diff --git a/StudentFileRename/App.xaml b/StudentFileRename/App.xaml index a20136a..649fb8d 100644 --- a/StudentFileRename/App.xaml +++ b/StudentFileRename/App.xaml @@ -1,29 +1,14 @@ - + + x:Class="StudentFileRename.App"> - - + + - - - - diff --git a/StudentFileRename/App.xaml.cs b/StudentFileRename/App.xaml.cs index f06a615..fcfae5b 100644 --- a/StudentFileRename/App.xaml.cs +++ b/StudentFileRename/App.xaml.cs @@ -1,53 +1,11 @@ -using StudentFileRename.Interface; -using StudentFileRename.Service; -using StudentFileRename.ViewModel; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Win32; -using Ookii.Dialogs.Wpf; -using System.Windows; -using StudentFileRename.View; -using Microsoft.Extensions.Logging; -using NLog.Extensions.Logging; +namespace StudentFileRename; -namespace StudentFileRename +public partial class App : Application { - /// - /// Interaction logic for App.xaml - /// - public partial class App : Application - { - private readonly ServiceProvider _serviceProvider; + public App() + { + InitializeComponent(); - public App() - { - ServiceCollection services = new ServiceCollection(); - ConfigureServices(services); - _serviceProvider = services.BuildServiceProvider(); - } - - private void ConfigureServices(IServiceCollection services) - { - services.AddSingleton() - .AddLogging(loggingBuilder => - { - loggingBuilder.ClearProviders(); - loggingBuilder.SetMinimumLevel(LogLevel.Trace); - loggingBuilder.AddNLog(); - }) - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton(); - } - - protected override void OnStartup(StartupEventArgs e) - { - base.OnStartup(e); - - var mainWindow = _serviceProvider.GetRequiredService(); - mainWindow.Show(); - } - } + MainPage = new AppShell(); + } } diff --git a/StudentFileRename/AppShell.xaml b/StudentFileRename/AppShell.xaml new file mode 100644 index 0000000..28b5e52 --- /dev/null +++ b/StudentFileRename/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/StudentFileRename/AppShell.xaml.cs b/StudentFileRename/AppShell.xaml.cs new file mode 100644 index 0000000..7b5e082 --- /dev/null +++ b/StudentFileRename/AppShell.xaml.cs @@ -0,0 +1,9 @@ +namespace StudentFileRename; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + } +} diff --git a/StudentFileRename/AssemblyInfo.cs b/StudentFileRename/AssemblyInfo.cs deleted file mode 100644 index 8b5504e..0000000 --- a/StudentFileRename/AssemblyInfo.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Windows; - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] diff --git a/StudentFileRename/Interface/IDialogService.cs b/StudentFileRename/Interface/IDialogService.cs deleted file mode 100644 index 7616784..0000000 --- a/StudentFileRename/Interface/IDialogService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; - -namespace StudentFileRename.Interface -{ - public interface IDialogService - { - public Task ShowDialog(object content); - } -} diff --git a/StudentFileRename/Interface/IFileDialogService.cs b/StudentFileRename/Interface/IFileDialogService.cs deleted file mode 100644 index c98a53f..0000000 --- a/StudentFileRename/Interface/IFileDialogService.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace StudentFileRename.Interface -{ - public interface IFileDialogService - { - public string GetFilePathFromExplorer(bool isFolder, string filter = null); - } -} diff --git a/StudentFileRename/Interface/IFileNameRetrievalService.cs b/StudentFileRename/Interface/IFileNameRetrievalService.cs deleted file mode 100644 index 95f1e09..0000000 --- a/StudentFileRename/Interface/IFileNameRetrievalService.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace StudentFileRename.Interface -{ - public interface IFileNameRetrievalService - { - string FindFilePathName(string filter, bool isFolder); - } -} diff --git a/StudentFileRename/MainPage.xaml b/StudentFileRename/MainPage.xaml new file mode 100644 index 0000000..93ce6ff --- /dev/null +++ b/StudentFileRename/MainPage.xaml @@ -0,0 +1,72 @@ + + + + + + + + + +