From 6361e14b88884dbff190362da3fbf69436c36e8d Mon Sep 17 00:00:00 2001 From: Geir Okkenhaug Jerstad Date: Mon, 6 Jan 2025 14:49:31 +0100 Subject: [PATCH] Dagen slutt --- .../ChatServer.cs | 2 +- .../DIP.ChatServer/DIP.ChatServer.csproj | 9 +++++++++ .../DependencyInversionPrinciple.ChatServer.csproj | 10 ++++++++++ .../DependencyInversionPrinciple.sln | 6 ++++++ .../DependencyInversionPrinciple.csproj | 4 ++++ .../DependencyInversionPrinciple/Program.cs | 8 +++++++- 6 files changed, 37 insertions(+), 2 deletions(-) rename Emne 3/DependencyInversionPrinciple/{DependencyInversionPrinciple => DIP.ChatServer}/ChatServer.cs (91%) create mode 100644 Emne 3/DependencyInversionPrinciple/DIP.ChatServer/DIP.ChatServer.csproj create mode 100644 Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple.ChatServer/DependencyInversionPrinciple.ChatServer.csproj diff --git a/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple/ChatServer.cs b/Emne 3/DependencyInversionPrinciple/DIP.ChatServer/ChatServer.cs similarity index 91% rename from Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple/ChatServer.cs rename to Emne 3/DependencyInversionPrinciple/DIP.ChatServer/ChatServer.cs index 43c554d..45ebc40 100644 --- a/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple/ChatServer.cs +++ b/Emne 3/DependencyInversionPrinciple/DIP.ChatServer/ChatServer.cs @@ -1,4 +1,4 @@ -namespace DependencyInversionPrinciple; +namespace DIP.ChatServer; public class ChatServer { diff --git a/Emne 3/DependencyInversionPrinciple/DIP.ChatServer/DIP.ChatServer.csproj b/Emne 3/DependencyInversionPrinciple/DIP.ChatServer/DIP.ChatServer.csproj new file mode 100644 index 0000000..3a63532 --- /dev/null +++ b/Emne 3/DependencyInversionPrinciple/DIP.ChatServer/DIP.ChatServer.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + + diff --git a/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple.ChatServer/DependencyInversionPrinciple.ChatServer.csproj b/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple.ChatServer/DependencyInversionPrinciple.ChatServer.csproj new file mode 100644 index 0000000..2f4fc77 --- /dev/null +++ b/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple.ChatServer/DependencyInversionPrinciple.ChatServer.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple.sln b/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple.sln index 449ea0a..5f1bdcf 100644 --- a/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple.sln +++ b/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple.sln @@ -2,6 +2,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DependencyInversionPrinciple", "DependencyInversionPrinciple\DependencyInversionPrinciple.csproj", "{D42BF79A-EB9A-4B1E-A7A8-E0C83D3CD844}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DIP.ChatServer", "DIP.ChatServer\DIP.ChatServer.csproj", "{DA3954AF-D3E2-4B05-B579-AFCF6540F1EF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -12,5 +14,9 @@ Global {D42BF79A-EB9A-4B1E-A7A8-E0C83D3CD844}.Debug|Any CPU.Build.0 = Debug|Any CPU {D42BF79A-EB9A-4B1E-A7A8-E0C83D3CD844}.Release|Any CPU.ActiveCfg = Release|Any CPU {D42BF79A-EB9A-4B1E-A7A8-E0C83D3CD844}.Release|Any CPU.Build.0 = Release|Any CPU + {DA3954AF-D3E2-4B05-B579-AFCF6540F1EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA3954AF-D3E2-4B05-B579-AFCF6540F1EF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA3954AF-D3E2-4B05-B579-AFCF6540F1EF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA3954AF-D3E2-4B05-B579-AFCF6540F1EF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple/DependencyInversionPrinciple.csproj b/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple/DependencyInversionPrinciple.csproj index 2f4fc77..c3ba7e3 100644 --- a/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple/DependencyInversionPrinciple.csproj +++ b/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple/DependencyInversionPrinciple.csproj @@ -7,4 +7,8 @@ enable + + + + diff --git a/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple/Program.cs b/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple/Program.cs index ad2ced3..415a2fa 100644 --- a/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple/Program.cs +++ b/Emne 3/DependencyInversionPrinciple/DependencyInversionPrinciple/Program.cs @@ -1,7 +1,13 @@ using DependencyInversionPrinciple; +using DIP.ChatServer; var server = new ChatServer(); var client1 = new ChatClient("Per", server); +var client2 = new ChatClient("Knut", server); +var client3 = new ChatClient("Espen", server); + +client1.Say("Hello"); +client2.Say("Hello"); +client3.Say("Hello"); -client1.Say("Hello"); \ No newline at end of file