Skip to content

Commit

Permalink
Refactor project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhxiao committed Jul 25, 2024
1 parent 48a4efb commit 7e75528
Show file tree
Hide file tree
Showing 30 changed files with 69 additions and 34 deletions.
2 changes: 2 additions & 0 deletions SMT.Console/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
10 changes: 10 additions & 0 deletions SMT.Console/SMT.Console.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion core/Configuration.cs → SMT.Core/Configuration.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace SoulsModTranslator.core;
namespace SMT.core;

public static class Configuration
{
Expand Down
2 changes: 1 addition & 1 deletion core/DB.cs → SMT.Core/DB.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.IO;

namespace SoulsModTranslator.core;
namespace SMT.core;

public class DB
{
Expand Down
2 changes: 1 addition & 1 deletion core/DBTool.cs → SMT.Core/DBTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text.Json.Serialization;
using NLog;

namespace SoulsModTranslator.core;
namespace SMT.core;

public static class DbTool
{
Expand Down
4 changes: 1 addition & 3 deletions core/Glossary.cs → SMT.Core/Glossary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
using System.IO;
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Windows.Documents;
using System.Windows.Shapes;
using NLog;

namespace SoulsModTranslator.core;
namespace SMT.core;

public class Glossary
{
Expand Down
2 changes: 1 addition & 1 deletion core/LangFile.cs → SMT.Core/LangFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using NLog;
using SoulsFormats;

namespace SoulsModTranslator.core;
namespace SMT.core;

public class LangFile
{
Expand Down
22 changes: 22 additions & 0 deletions SMT.Core/SMT.Core.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<TargetFramework>net7.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<Reference Include="SoulsFormats">
<HintPath>SoulsFormats.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="NPOI" Version="2.7.0" />
<PackageReference Include="NLog" Version="5.2.8" />
<PackageReference Include="NLog.Config" Version="4.7.15" />
</ItemGroup>

</Project>
File renamed without changes.
2 changes: 1 addition & 1 deletion core/TextExporter.cs → SMT.Core/TextExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using NLog;
using NPOI.XSSF.UserModel;

namespace SoulsModTranslator.core;
namespace SMT.core;

public static class TextExporter
{
Expand Down
6 changes: 2 additions & 4 deletions core/TextImporter.cs → SMT.Core/TextImporter.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System.IO;
using Microsoft.VisualBasic.Logging;
using NPOI.XSSF.UserModel;
using NPOI.XSSF.UserModel;

namespace SoulsModTranslator.core;
namespace SMT.core;

public class TextImporter
{
Expand Down
3 changes: 1 addition & 2 deletions core/Translator.cs → SMT.Core/Translator.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System.Diagnostics;
using System.IO;
using System.Windows.Forms.Design;
using NLog;
using NPOI.SS.Formula;
using NPOI.SS.Formula.Functions;
using SoulsFormats;

namespace SoulsModTranslator.core;
namespace SMT.core;

public class ExportResult
{
Expand Down
2 changes: 1 addition & 1 deletion core/Utils.cs → SMT.Core/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Text.Json;
using System.Text.RegularExpressions;

namespace SoulsModTranslator.core;
namespace SMT.core;

public static class Utils
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion MainWindow.xaml → SMT.WPF/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<adonisControls:AdonisWindow x:Class="SoulsModTranslator.MainWindow"
<adonisControls:AdonisWindow x:Class="SMT.WPF.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI"
Expand Down
5 changes: 3 additions & 2 deletions MainWindow.xaml.cs → SMT.WPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using System.Windows;
using System.Collections.ObjectModel;
using NLog;
using SoulsModTranslator.core;
using System.IO;
using AdonisUI.Controls;
using Button = System.Windows.Controls.Button;
using MessageBoxImage = AdonisUI.Controls.MessageBoxImage;
using System.Diagnostics;
using System.Windows.Navigation;
using NLog.Targets;
using SMT.core;

namespace SoulsModTranslator
namespace SMT.WPF
{
/// <summary>
/// Interaction logic for MainWindow.xaml
Expand Down Expand Up @@ -65,6 +65,7 @@ private static void ShowTaskResult(bool success, string succMsg, string failMsg)

System.Windows.Clipboard.SetText(prompt + text);
Utils.OpenURL("https://www.bilibili.com/video/BV17p421Q7qJ/");

}
}

Expand Down
9 changes: 4 additions & 5 deletions SoulsModTranslator.csproj → SMT.WPF/SMT.WPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>

<ItemGroup>
<Reference Include="SoulsFormats">
<HintPath>SoulsFormats.dll</HintPath>
</Reference>
<ProjectReference Include="..\SMT.Core\SMT.Core.csproj" />
</ItemGroup>



<ItemGroup>
<PackageReference Include="AdonisUI" Version="1.17.1" />
<PackageReference Include="AdonisUI.ClassicTheme" Version="1.17.1" />
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 17 additions & 5 deletions SoulsModTranslator.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,30 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34622.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoulsModTranslator", "SoulsModTranslator.csproj", "{D379C4A1-B6A7-4285-8B54-264ED790B32E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SMT.Core", "SMT.Core\SMT.Core.csproj", "{8FA1EB8C-6B7C-4297-B0D0-33369DADBBBF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SMT.Console", "SMT.Console\SMT.Console.csproj", "{1A22A8F0-87AE-46B3-8A43-E09EDE1C7B0E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SMT.WPF", "SMT.WPF\SMT.WPF.csproj", "{36BEFF02-74CD-4A7A-A008-B53EC51D9719}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D379C4A1-B6A7-4285-8B54-264ED790B32E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D379C4A1-B6A7-4285-8B54-264ED790B32E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D379C4A1-B6A7-4285-8B54-264ED790B32E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D379C4A1-B6A7-4285-8B54-264ED790B32E}.Release|Any CPU.Build.0 = Release|Any CPU
{8FA1EB8C-6B7C-4297-B0D0-33369DADBBBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8FA1EB8C-6B7C-4297-B0D0-33369DADBBBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8FA1EB8C-6B7C-4297-B0D0-33369DADBBBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8FA1EB8C-6B7C-4297-B0D0-33369DADBBBF}.Release|Any CPU.Build.0 = Release|Any CPU
{1A22A8F0-87AE-46B3-8A43-E09EDE1C7B0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A22A8F0-87AE-46B3-8A43-E09EDE1C7B0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A22A8F0-87AE-46B3-8A43-E09EDE1C7B0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A22A8F0-87AE-46B3-8A43-E09EDE1C7B0E}.Release|Any CPU.Build.0 = Release|Any CPU
{36BEFF02-74CD-4A7A-A008-B53EC51D9719}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36BEFF02-74CD-4A7A-A008-B53EC51D9719}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36BEFF02-74CD-4A7A-A008-B53EC51D9719}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36BEFF02-74CD-4A7A-A008-B53EC51D9719}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 0 additions & 6 deletions SoulsModTranslator.sln.DotSettings.user

This file was deleted.

0 comments on commit 7e75528

Please sign in to comment.