From a3df85c87e0051b07b155f6bccdee0eae0f66532 Mon Sep 17 00:00:00 2001 From: Robert McRackan Date: Mon, 1 Aug 2022 11:59:55 -0400 Subject: [PATCH] Refactor hangover --- Source/Hangover/Form1.Database.cs | 140 ---------------- .../HangoverAvalonia/HangoverAvalonia.csproj | 14 +- .../ViewModels/MainWindowViewModel.cs | 135 ++------------- Source/HangoverBase/DatabaseTab.cs | 154 ++++++++++++++++++ Source/HangoverBase/HangoverBase.csproj | 20 +++ .../Form1.CLI.cs | 2 +- Source/HangoverWinForms/Form1.Database.cs | 31 ++++ .../Form1.Designer.cs | 2 +- .../{Hangover => HangoverWinForms}/Form1.cs | 2 +- .../{Hangover => HangoverWinForms}/Form1.resx | 0 .../HangoverWinForms.csproj} | 6 +- .../{Hangover => HangoverWinForms}/Program.cs | 2 +- .../PublishProfiles/WindowsProfile.pubxml | 0 .../Hangover icon/spilled-glass-with-glow.ico | Bin .../spilled-glass-with-glow_128.png | Bin .../spilled-glass-with-glow_16.png | Bin .../spilled-glass-with-glow_256.png | Bin .../spilled-glass-with-glow_32.png | Bin .../spilled-glass-with-glow_512.png | Bin .../spilled-glass-with-glow_512x512.pdn | Bin .../spilled-glass-with-glow_64.png | Bin .../hangover.ico | Bin Source/Libation.sln | 9 +- 23 files changed, 241 insertions(+), 276 deletions(-) delete mode 100644 Source/Hangover/Form1.Database.cs create mode 100644 Source/HangoverBase/DatabaseTab.cs create mode 100644 Source/HangoverBase/HangoverBase.csproj rename Source/{Hangover => HangoverWinForms}/Form1.CLI.cs (91%) create mode 100644 Source/HangoverWinForms/Form1.Database.cs rename Source/{Hangover => HangoverWinForms}/Form1.Designer.cs (99%) rename Source/{Hangover => HangoverWinForms}/Form1.cs (91%) rename Source/{Hangover => HangoverWinForms}/Form1.resx (100%) rename Source/{Hangover/Hangover.csproj => HangoverWinForms/HangoverWinForms.csproj} (87%) rename Source/{Hangover => HangoverWinForms}/Program.cs (94%) rename Source/{Hangover => HangoverWinForms}/Properties/PublishProfiles/WindowsProfile.pubxml (100%) rename Source/{Hangover => HangoverWinForms}/Resources/Hangover icon/spilled-glass-with-glow.ico (100%) rename Source/{Hangover => HangoverWinForms}/Resources/Hangover icon/spilled-glass-with-glow_128.png (100%) rename Source/{Hangover => HangoverWinForms}/Resources/Hangover icon/spilled-glass-with-glow_16.png (100%) rename Source/{Hangover => HangoverWinForms}/Resources/Hangover icon/spilled-glass-with-glow_256.png (100%) rename Source/{Hangover => HangoverWinForms}/Resources/Hangover icon/spilled-glass-with-glow_32.png (100%) rename Source/{Hangover => HangoverWinForms}/Resources/Hangover icon/spilled-glass-with-glow_512.png (100%) rename Source/{Hangover => HangoverWinForms}/Resources/Hangover icon/spilled-glass-with-glow_512x512.pdn (100%) rename Source/{Hangover => HangoverWinForms}/Resources/Hangover icon/spilled-glass-with-glow_64.png (100%) rename Source/{Hangover => HangoverWinForms}/hangover.ico (100%) diff --git a/Source/Hangover/Form1.Database.cs b/Source/Hangover/Form1.Database.cs deleted file mode 100644 index 74a0445d..00000000 --- a/Source/Hangover/Form1.Database.cs +++ /dev/null @@ -1,140 +0,0 @@ -using ApplicationServices; -using AppScaffolding; -using Microsoft.EntityFrameworkCore; - -namespace Hangover -{ - public partial class Form1 - { - private string dbFile; - - private void Load_databaseTab() - { - dbFile = UNSAFE_MigrationHelper.DatabaseFile; - if (dbFile is null) - { - databaseFileLbl.Text = $"Database file not found"; - return; - } - - databaseFileLbl.Text = $"Database file: {UNSAFE_MigrationHelper.DatabaseFile ?? "not found"}"; - } - - private void databaseTab_VisibleChanged(object sender, EventArgs e) - { - if (!databaseTab.Visible) - return; - } - - private void sqlExecuteBtn_Click(object sender, EventArgs e) - { - ensureBackup(); - - sqlResultsTb.Clear(); - - try - { - var sql = sqlTb.Text.Trim(); - - #region // explanation - // Routing statements to non-query is a convenience. - // I went down the rabbit hole of full parsing and it's more trouble than it's worth. The parsing is easy due to available libraries. The edge cases of what to do next got too complex for slight gains. - // It's also not useful to take the extra effort to separate non-queries which don't return a row count. Eg: alter table, drop table - // My half-assed solution here won't even catch simple mistakes like this -- and that's ok - // -- line 1 is a comment - // delete from foo - #endregion - var lower = sql.ToLower(); - if (lower.StartsWith("update") || lower.StartsWith("insert") || lower.StartsWith("delete")) - nonQuery(sql); - else - query(sql); - } - catch (Exception ex) - { - sqlResultsTb.Text = $"{ex.Message}\r\n{ex.StackTrace}"; - } - finally - { - deleteUnneededBackups(); - } - } - - private string dbBackup; - private DateTime dbFileLastModified; - private void ensureBackup() - { - if (dbBackup is not null) - return; - - dbFileLastModified = File.GetLastWriteTimeUtc(dbFile); - - dbBackup - = Path.ChangeExtension(dbFile, "").TrimEnd('.') - + $"_backup_{DateTime.UtcNow:O}".Replace(':', '-').Replace('.', '-') - + Path.GetExtension(dbFile); - File.Copy(dbFile, dbBackup); - } - - private void deleteUnneededBackups() - { - var newLastModified = File.GetLastWriteTimeUtc(dbFile); - if (dbFileLastModified == newLastModified) - { - File.Delete(dbBackup); - dbBackup = null; - } - } - - void query(string sql) - { - // ef doesn't support truly generic queries. have to drop down to ado.net - using var context = DbContexts.GetContext(); - using var conn = context.Database.GetDbConnection(); - conn.Open(); - using var cmd = conn.CreateCommand(); - cmd.CommandText = sql; - - var reader = cmd.ExecuteReader(); - var results = 0; - var builder = new System.Text.StringBuilder(); - var lines = 0; - while (reader.Read()) - { - results++; - - for (var i = 0; i < reader.FieldCount; i++) - builder.Append(reader.GetValue(i) + "\t"); - builder.AppendLine(); - - lines++; - if (lines % 10 == 0) - { - sqlResultsTb.AppendText(builder.ToString()); - builder.Clear(); - } - } - - sqlResultsTb.AppendText(builder.ToString()); - builder.Clear(); - - if (results == 0) - sqlResultsTb.Text = "[no results]"; - else - { - sqlResultsTb.AppendText($"\r\n{results} result"); - if (results != 1) sqlResultsTb.AppendText("s"); - } - } - - void nonQuery(string sql) - { - using var context = DbContexts.GetContext(); - var results = context.Database.ExecuteSqlRaw(sql); - - sqlResultsTb.AppendText($"{results} record"); - if (results != 1) sqlResultsTb.AppendText("s"); - sqlResultsTb.AppendText(" affected"); - } - } -} diff --git a/Source/HangoverAvalonia/HangoverAvalonia.csproj b/Source/HangoverAvalonia/HangoverAvalonia.csproj index 055cae7f..7f6b7652 100644 --- a/Source/HangoverAvalonia/HangoverAvalonia.csproj +++ b/Source/HangoverAvalonia/HangoverAvalonia.csproj @@ -20,6 +20,16 @@ hangover.ico + + + en;es + + ..\bin\Avalonia\Debug embedded @@ -61,9 +71,7 @@ - - - + diff --git a/Source/HangoverAvalonia/ViewModels/MainWindowViewModel.cs b/Source/HangoverAvalonia/ViewModels/MainWindowViewModel.cs index 607e3ddb..a578811b 100644 --- a/Source/HangoverAvalonia/ViewModels/MainWindowViewModel.cs +++ b/Source/HangoverAvalonia/ViewModels/MainWindowViewModel.cs @@ -1,17 +1,13 @@ -using ApplicationServices; -using AppScaffolding; -using Microsoft.EntityFrameworkCore; -using ReactiveUI; using System; -using System.Collections.Generic; -using System.IO; -using System.Text; +using HangoverBase; +using ReactiveUI; namespace HangoverAvalonia.ViewModels { public class MainWindowViewModel : ViewModelBase { - private string dbFile; + private DatabaseTab _tab; + private string _databaseFileText; private bool _databaseFound; private string _sqlResults; @@ -22,129 +18,20 @@ namespace HangoverAvalonia.ViewModels public MainWindowViewModel() { - dbFile = UNSAFE_MigrationHelper.DatabaseFile; - if (dbFile is null) + _tab = new(new(() => SqlQuery, s => SqlResults = s, s => SqlResults = s)); + + _tab.LoadDatabaseFile(); + if (_tab.DbFile is null) { DatabaseFileText = $"Database file not found"; DatabaseFound = false; return; } - DatabaseFileText = $"Database file: {UNSAFE_MigrationHelper.DatabaseFile ?? "not found"}"; - - DatabaseFound = UNSAFE_MigrationHelper.DatabaseFile is not null; + DatabaseFileText = $"Database file: {_tab.DbFile}"; + DatabaseFound = true; } - public void ExecuteQuery() - { - ensureBackup(); - - SqlResults = string.Empty; - - try - { - var sql = SqlQuery.Trim(); - - #region // explanation - // Routing statements to non-query is a convenience. - // I went down the rabbit hole of full parsing and it's more trouble than it's worth. The parsing is easy due to available libraries. The edge cases of what to do next got too complex for slight gains. - // It's also not useful to take the extra effort to separate non-queries which don't return a row count. Eg: alter table, drop table - // My half-assed solution here won't even catch simple mistakes like this -- and that's ok - // -- line 1 is a comment - // delete from foo - #endregion - var lower = sql.ToLower(); - if (lower.StartsWith("update") || lower.StartsWith("insert") || lower.StartsWith("delete")) - nonQuery(sql); - else - query(sql); - } - catch (Exception ex) - { - SqlResults = $"{ex.Message}\r\n{ex.StackTrace}"; - } - finally - { - deleteUnneededBackups(); - } - } - - private string dbBackup; - private DateTime dbFileLastModified; - - private void ensureBackup() - { - if (dbBackup is not null) - return; - - dbFileLastModified = File.GetLastWriteTimeUtc(dbFile); - - dbBackup - = Path.ChangeExtension(dbFile, "").TrimEnd('.') - + $"_backup_{DateTime.UtcNow:O}".Replace(':', '-').Replace('.', '-') - + Path.GetExtension(dbFile); - File.Copy(dbFile, dbBackup); - } - - private void deleteUnneededBackups() - { - var newLastModified = File.GetLastWriteTimeUtc(dbFile); - if (dbFileLastModified == newLastModified) - { - File.Delete(dbBackup); - dbBackup = null; - } - } - - void query(string sql) - { - // ef doesn't support truly generic queries. have to drop down to ado.net - using var context = DbContexts.GetContext(); - using var conn = context.Database.GetDbConnection(); - conn.Open(); - using var cmd = conn.CreateCommand(); - cmd.CommandText = sql; - - var reader = cmd.ExecuteReader(); - var results = 0; - var builder = new StringBuilder(); - var lines = 0; - while (reader.Read()) - { - results++; - - for (var i = 0; i < reader.FieldCount; i++) - builder.Append(reader.GetValue(i) + "\t"); - builder.AppendLine(); - - lines++; - if (lines % 10 == 0) - { - SqlResults += builder.ToString(); - builder.Clear(); - } - } - - SqlResults += builder.ToString(); - builder.Clear(); - - if (results == 0) - SqlResults = "[no results]"; - else - { - SqlResults += $"\r\n{results} result"; - if (results != 1) SqlResults += "s"; - } - } - - void nonQuery(string sql) - { - using var context = DbContexts.GetContext(); - var results = context.Database.ExecuteSqlRaw(sql); - - SqlResults += $"{results} record"; - if (results != 1) SqlResults += "s"; - SqlResults += " affected"; - } + public void ExecuteQuery() => _tab.ExecuteQuery(); } } diff --git a/Source/HangoverBase/DatabaseTab.cs b/Source/HangoverBase/DatabaseTab.cs new file mode 100644 index 00000000..b9bcc88d --- /dev/null +++ b/Source/HangoverBase/DatabaseTab.cs @@ -0,0 +1,154 @@ +using System.Text; +using ApplicationServices; +using AppScaffolding; +using Dinah.Core; +using Microsoft.EntityFrameworkCore; + +namespace HangoverBase +{ + public class DatabaseTabCommands + { + public Func SqlInput { get; } + public Action SqlOutputAppend { get; } + public Action SqlOutputOverwrite { get; } + + public DatabaseTabCommands() { } + public DatabaseTabCommands( + Func sqlInput, + Action sqlDisplayAppend, + Action sqlDisplayOverwrite) + { + SqlInput = ArgumentValidator.EnsureNotNull(sqlInput, nameof(sqlInput)); + SqlOutputAppend = ArgumentValidator.EnsureNotNull(sqlDisplayAppend, nameof(sqlDisplayAppend)); + SqlOutputOverwrite = ArgumentValidator.EnsureNotNull(sqlDisplayOverwrite, nameof(sqlDisplayOverwrite)); + } + } + + public class DatabaseTab + { + private DatabaseTabCommands _commands { get; } + public string DbFile { get; private set; } + + public DatabaseTab(DatabaseTabCommands commands) + { + _commands = ArgumentValidator.EnsureNotNull(commands, nameof(commands)); + + ArgumentValidator.EnsureNotNull(commands, nameof(_commands.SqlInput)); + ArgumentValidator.EnsureNotNull(commands, nameof(_commands.SqlOutputAppend)); + ArgumentValidator.EnsureNotNull(commands, nameof(_commands.SqlOutputOverwrite)); + } + + public void LoadDatabaseFile() => DbFile = UNSAFE_MigrationHelper.DatabaseFile; + + private string dbBackup; + private DateTime dbFileLastModified; + public void EnsureBackup() + { + if (dbBackup is not null) + return; + + dbFileLastModified = File.GetLastWriteTimeUtc(DbFile); + + dbBackup + = Path.ChangeExtension(DbFile, "").TrimEnd('.') + + $"_backup_{DateTime.UtcNow:O}".Replace(':', '-').Replace('.', '-') + + Path.GetExtension(DbFile); + File.Copy(DbFile, dbBackup); + } + + public void ExecuteQuery() + { + EnsureBackup(); + + _commands.SqlOutputOverwrite(""); + + try + { + var sql = _commands.SqlInput().Trim(); + + #region // explanation + // Routing statements to non-query is a convenience. + // I went down the rabbit hole of full parsing and it's more trouble than it's worth. The parsing is easy due to available libraries. The edge cases of what to do next got too complex for slight gains. + // It's also not useful to take the extra effort to separate non-queries which don't return a row count. Eg: alter table, drop table + // My half-assed solution here won't even catch simple mistakes like this -- and that's ok + // -- line 1 is a comment + // delete from foo + #endregion + var lower = sql.ToLower(); + if (lower.StartsWith("update") || lower.StartsWith("insert") || lower.StartsWith("delete")) + NonQuery(sql); + else + Query(sql); + } + catch (Exception ex) + { + _commands.SqlOutputOverwrite($"{ex.Message}\r\n{ex.StackTrace}"); + } + finally + { + DeleteUnneededBackups(); + } + } + + public void DeleteUnneededBackups() + { + var newLastModified = File.GetLastWriteTimeUtc(DbFile); + if (dbFileLastModified == newLastModified) + { + File.Delete(dbBackup); + dbBackup = null; + } + } + + public void Query(string sql) + { + // ef doesn't support truly generic queries. have to drop down to ado.net + using var context = DbContexts.GetContext(); + using var conn = context.Database.GetDbConnection(); + conn.Open(); + using var cmd = conn.CreateCommand(); + cmd.CommandText = sql; + + var reader = cmd.ExecuteReader(); + var results = 0; + var builder = new StringBuilder(); + var lines = 0; + while (reader.Read()) + { + results++; + + for (var i = 0; i < reader.FieldCount; i++) + builder.Append(reader.GetValue(i) + "\t"); + builder.AppendLine(); + + lines++; + if (lines % 10 == 0) + { + _commands.SqlOutputAppend(builder.ToString()); + builder.Clear(); + } + } + + _commands.SqlOutputAppend(builder.ToString()); + builder.Clear(); + + if (results == 0) + _commands.SqlOutputOverwrite("[no results]"); + else + { + _commands.SqlOutputAppend($"\r\n{results} result"); + if (results != 1) _commands.SqlOutputAppend("s"); + } + } + + public void NonQuery(string sql) + { + using var context = DbContexts.GetContext(); + var results = context.Database.ExecuteSqlRaw(sql); + + _commands.SqlOutputAppend($"{results} record"); + if (results != 1) _commands.SqlOutputAppend("s"); + _commands.SqlOutputAppend(" affected"); + } + } +} diff --git a/Source/HangoverBase/HangoverBase.csproj b/Source/HangoverBase/HangoverBase.csproj new file mode 100644 index 00000000..12b4b19e --- /dev/null +++ b/Source/HangoverBase/HangoverBase.csproj @@ -0,0 +1,20 @@ + + + + net6.0 + enable + + + + + + + + + embedded + + + embedded + + + diff --git a/Source/Hangover/Form1.CLI.cs b/Source/HangoverWinForms/Form1.CLI.cs similarity index 91% rename from Source/Hangover/Form1.CLI.cs rename to Source/HangoverWinForms/Form1.CLI.cs index 55100457..bb3cb12c 100644 --- a/Source/Hangover/Form1.CLI.cs +++ b/Source/HangoverWinForms/Form1.CLI.cs @@ -1,6 +1,6 @@ using AppScaffolding; -namespace Hangover +namespace HangoverWinForms { public partial class Form1 { diff --git a/Source/HangoverWinForms/Form1.Database.cs b/Source/HangoverWinForms/Form1.Database.cs new file mode 100644 index 00000000..e7676414 --- /dev/null +++ b/Source/HangoverWinForms/Form1.Database.cs @@ -0,0 +1,31 @@ +using HangoverBase; + +namespace HangoverWinForms +{ + public partial class Form1 + { + private DatabaseTab _tab; + + private void Load_databaseTab() + { + _tab = new(new(() => sqlTb.Text, sqlResultsTb.AppendText, s => sqlResultsTb.Text = s)); + + _tab.LoadDatabaseFile(); + if (_tab.DbFile is null) + { + databaseFileLbl.Text = $"Database file not found"; + return; + } + + databaseFileLbl.Text = $"Database file: {_tab.DbFile}"; + } + + private void databaseTab_VisibleChanged(object sender, EventArgs e) + { + if (!databaseTab.Visible) + return; + } + + private void sqlExecuteBtn_Click(object sender, EventArgs e) => _tab.ExecuteQuery(); + } +} diff --git a/Source/Hangover/Form1.Designer.cs b/Source/HangoverWinForms/Form1.Designer.cs similarity index 99% rename from Source/Hangover/Form1.Designer.cs rename to Source/HangoverWinForms/Form1.Designer.cs index 8986ed87..45a96525 100644 --- a/Source/Hangover/Form1.Designer.cs +++ b/Source/HangoverWinForms/Form1.Designer.cs @@ -1,4 +1,4 @@ -namespace Hangover +namespace HangoverWinForms { partial class Form1 { diff --git a/Source/Hangover/Form1.cs b/Source/HangoverWinForms/Form1.cs similarity index 91% rename from Source/Hangover/Form1.cs rename to Source/HangoverWinForms/Form1.cs index c4d68072..99f746ca 100644 --- a/Source/Hangover/Form1.cs +++ b/Source/HangoverWinForms/Form1.cs @@ -1,4 +1,4 @@ -namespace Hangover +namespace HangoverWinForms { public partial class Form1 : Form { diff --git a/Source/Hangover/Form1.resx b/Source/HangoverWinForms/Form1.resx similarity index 100% rename from Source/Hangover/Form1.resx rename to Source/HangoverWinForms/Form1.resx diff --git a/Source/Hangover/Hangover.csproj b/Source/HangoverWinForms/HangoverWinForms.csproj similarity index 87% rename from Source/Hangover/Hangover.csproj rename to Source/HangoverWinForms/HangoverWinForms.csproj index 6e87340d..da3934ca 100644 --- a/Source/Hangover/Hangover.csproj +++ b/Source/HangoverWinForms/HangoverWinForms.csproj @@ -44,9 +44,7 @@ - - - + @@ -55,7 +53,7 @@ - + diff --git a/Source/Hangover/Program.cs b/Source/HangoverWinForms/Program.cs similarity index 94% rename from Source/Hangover/Program.cs rename to Source/HangoverWinForms/Program.cs index 247aa4c3..2e50791a 100644 --- a/Source/Hangover/Program.cs +++ b/Source/HangoverWinForms/Program.cs @@ -1,4 +1,4 @@ -namespace Hangover +namespace HangoverWinForms { internal static class Program { diff --git a/Source/Hangover/Properties/PublishProfiles/WindowsProfile.pubxml b/Source/HangoverWinForms/Properties/PublishProfiles/WindowsProfile.pubxml similarity index 100% rename from Source/Hangover/Properties/PublishProfiles/WindowsProfile.pubxml rename to Source/HangoverWinForms/Properties/PublishProfiles/WindowsProfile.pubxml diff --git a/Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow.ico b/Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow.ico similarity index 100% rename from Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow.ico rename to Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow.ico diff --git a/Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow_128.png b/Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow_128.png similarity index 100% rename from Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow_128.png rename to Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow_128.png diff --git a/Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow_16.png b/Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow_16.png similarity index 100% rename from Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow_16.png rename to Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow_16.png diff --git a/Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow_256.png b/Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow_256.png similarity index 100% rename from Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow_256.png rename to Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow_256.png diff --git a/Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow_32.png b/Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow_32.png similarity index 100% rename from Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow_32.png rename to Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow_32.png diff --git a/Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow_512.png b/Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow_512.png similarity index 100% rename from Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow_512.png rename to Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow_512.png diff --git a/Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow_512x512.pdn b/Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow_512x512.pdn similarity index 100% rename from Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow_512x512.pdn rename to Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow_512x512.pdn diff --git a/Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow_64.png b/Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow_64.png similarity index 100% rename from Source/Hangover/Resources/Hangover icon/spilled-glass-with-glow_64.png rename to Source/HangoverWinForms/Resources/Hangover icon/spilled-glass-with-glow_64.png diff --git a/Source/Hangover/hangover.ico b/Source/HangoverWinForms/hangover.ico similarity index 100% rename from Source/Hangover/hangover.ico rename to Source/HangoverWinForms/hangover.ico diff --git a/Source/Libation.sln b/Source/Libation.sln index 7c4ca3eb..23978f3a 100644 --- a/Source/Libation.sln +++ b/Source/Libation.sln @@ -64,12 +64,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FileManager.Tests", "_Tests EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibationFileManager.Tests", "_Tests\LibationFileManager.Tests\LibationFileManager.Tests.csproj", "{EB781571-8548-477E-82AD-FB9FAB548D2F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hangover", "Hangover\Hangover.csproj", "{40C67036-C1A7-4FDF-AA83-8EC902E257F3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HangoverWinForms", "HangoverWinForms\HangoverWinForms.csproj", "{40C67036-C1A7-4FDF-AA83-8EC902E257F3}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibationAvalonia", "LibationAvalonia\LibationAvalonia.csproj", "{F612D06F-3134-4B9B-95CD-EB3FC798AE60}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HangoverAvalonia", "HangoverAvalonia\HangoverAvalonia.csproj", "{8A7B01D3-9830-44FD-91A1-D8D010996BEB}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HangoverBase", "HangoverBase\HangoverBase.csproj", "{5C7005BA-7D83-4E99-8073-D970943A7D61}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -156,6 +158,10 @@ Global {8A7B01D3-9830-44FD-91A1-D8D010996BEB}.Debug|Any CPU.Build.0 = Debug|Any CPU {8A7B01D3-9830-44FD-91A1-D8D010996BEB}.Release|Any CPU.ActiveCfg = Release|Any CPU {8A7B01D3-9830-44FD-91A1-D8D010996BEB}.Release|Any CPU.Build.0 = Release|Any CPU + {5C7005BA-7D83-4E99-8073-D970943A7D61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C7005BA-7D83-4E99-8073-D970943A7D61}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C7005BA-7D83-4E99-8073-D970943A7D61}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C7005BA-7D83-4E99-8073-D970943A7D61}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -181,6 +187,7 @@ Global {40C67036-C1A7-4FDF-AA83-8EC902E257F3} = {8679CAC8-9164-4007-BDD2-F004810EDA14} {F612D06F-3134-4B9B-95CD-EB3FC798AE60} = {8679CAC8-9164-4007-BDD2-F004810EDA14} {8A7B01D3-9830-44FD-91A1-D8D010996BEB} = {8679CAC8-9164-4007-BDD2-F004810EDA14} + {5C7005BA-7D83-4E99-8073-D970943A7D61} = {8679CAC8-9164-4007-BDD2-F004810EDA14} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {615E00ED-BAEF-4E8E-A92A-9B82D87942A9}