From 32d47bcf20559a2cfa7248283058781c17b62b11 Mon Sep 17 00:00:00 2001 From: "allen.yan" Date: Fri, 21 Mar 2025 09:38:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=96=E6=AA=94=E8=88=87=E6=96=87=E6=AA=94?= =?UTF-8?q?=E6=94=B9=E5=88=B0outputfileI=E8=B3=87=E6=96=99=E5=A4=BE=202025?= =?UTF-8?q?0321?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Index.xaml | 29 +++ Index.xaml.cs | 10 +- MainViewModel.cs | 10 +- Properties/Resources.resx | 2 +- RoomDetailsWindow.xaml | 37 ++++ RoomDetailsWindow.xaml.cs | 199 ++++++++++++++++++++ outputfile/Imagers/bug.jpg | Bin 0 -> 5048 bytes outputfile/Imagers/cache.jpg | Bin 0 -> 5064 bytes outputfile/Imagers/film.jpg | Bin 0 -> 9171 bytes images.jpg => outputfile/Imagers/images.jpg | Bin outputfile/Imagers/user.jpg | Bin 0 -> 8039 bytes outputfile/txt/marquee1_items.txt | 11 ++ outputfile/txt/marquee2_items.txt | 8 + outputfile/txt/marquee_items.txt | 13 ++ outputfile/txt/room.txt | 3 + 15 files changed, 311 insertions(+), 11 deletions(-) create mode 100644 RoomDetailsWindow.xaml create mode 100644 RoomDetailsWindow.xaml.cs create mode 100644 outputfile/Imagers/bug.jpg create mode 100644 outputfile/Imagers/cache.jpg create mode 100644 outputfile/Imagers/film.jpg rename images.jpg => outputfile/Imagers/images.jpg (100%) create mode 100644 outputfile/Imagers/user.jpg create mode 100644 outputfile/txt/marquee1_items.txt create mode 100644 outputfile/txt/marquee2_items.txt create mode 100644 outputfile/txt/marquee_items.txt create mode 100644 outputfile/txt/room.txt diff --git a/Index.xaml b/Index.xaml index 379a446..30add5c 100644 --- a/Index.xaml +++ b/Index.xaml @@ -378,6 +378,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Index.xaml.cs b/Index.xaml.cs index ab1ccb4..87f35b1 100644 --- a/Index.xaml.cs +++ b/Index.xaml.cs @@ -65,7 +65,7 @@ namespace Karaoke_Kingpin [DllImport("kernel32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool AllocConsole(); - + // 添加一個新的類來保存房間狀態信息 private class RoomState { @@ -145,7 +145,7 @@ namespace Karaoke_Kingpin MarqueeItems.Add(content); // Append newEntry to marquee_items.txt - string filePath = @"txt\marquee_items.txt"; + string filePath = @"outputfile\txt\marquee_items.txt"; using (StreamWriter sw = File.AppendText(filePath)) { sw.WriteLine(content); @@ -191,7 +191,7 @@ namespace Karaoke_Kingpin } // Save the updated list to marquee_items.txt - string filePath = @"txt\marquee_items.txt"; + string filePath = @"outputfile\txt\marquee_items.txt"; File.WriteAllLines(filePath, MarqueeItems); // Clear input box @@ -207,7 +207,7 @@ namespace Karaoke_Kingpin MarqueeItems.Remove(selectedItem); // Update marquee_items.txt - string filePath = @"txt\marquee_items.txt"; + string filePath = @"outputfile\txt\marquee_items.txt"; var lines = File.ReadAllLines(filePath).ToList(); lines.Remove(selectedItem); File.WriteAllLines(filePath, lines); @@ -220,7 +220,7 @@ namespace Karaoke_Kingpin private void LoadRoomsFromTextFile() { - var lines = File.ReadAllLines(@"txt\room.txt"); + var lines = File.ReadAllLines(@"outputfile\txt\room.txt"); foreach (var line in lines) { diff --git a/MainViewModel.cs b/MainViewModel.cs index bb6e2b7..0b633a7 100644 --- a/MainViewModel.cs +++ b/MainViewModel.cs @@ -137,11 +137,11 @@ namespace Karaoke_Kingpin public MainViewModel() { // Initialize with the image filename - CacheImage = "cache.jpg"; - FilmImage = "film.jpg"; - BugImage = "bug.jpg"; - UserImage = "user.jpg"; - ImagesImage = "images.jpg"; + CacheImage = @"outputfile\Imagers\cache.jpg"; + FilmImage = @"outputfile\Imagers\film.jpg"; + BugImage = @"outputfile\Imagers\bug.jpg"; + UserImage = @"outputfile\Imagers\user.jpg"; + ImagesImage = @"outputfile\Imagers\images.jpg"; // Initialize Marquee Items Marquee1Items = new ObservableCollection(File.ReadAllLines(@"txt\marquee1_items.txt")); diff --git a/Properties/Resources.resx b/Properties/Resources.resx index 08ac045..b540dce 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -119,6 +119,6 @@ - ..\images.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\outputfile\Imagers\images.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/RoomDetailsWindow.xaml b/RoomDetailsWindow.xaml new file mode 100644 index 0000000..ae7fb3a --- /dev/null +++ b/RoomDetailsWindow.xaml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + +