first commit

This commit is contained in:
allen.yan 2025-03-19 10:04:16 +08:00
commit 02581fc427
28 changed files with 65879 additions and 0 deletions

63
.gitattributes vendored Normal file
View File

@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

363
.gitignore vendored Normal file
View File

@ -0,0 +1,363 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd

42
App.config Normal file
View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Xceed.Wpf.AvalonDock" publicKeyToken="3e4669d2f30244f4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.6.0.0" newVersion="4.6.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SQLitePCLRaw.core" publicKeyToken="1488e028ca7ab535" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.1.8.2226" newVersion="2.1.8.2226"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6"/>
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite.EF6"/>
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6"/>
<remove invariant="System.Data.SQLite"/><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"/></DbProviderFactories>
</system.data>
</configuration>

10
App.xaml Normal file
View File

@ -0,0 +1,10 @@
<Application x:Class="Karaoke_Kingpin.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Karaoke_Kingpin"
xmlns:converters="clr-namespace:Karaoke_Kingpin.Converters"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

24
App.xaml.cs Normal file
View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace Karaoke_Kingpin
{
/// <summary>
/// App.xaml 的互動邏輯
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
// 這裡設置你的 Xceed LicenseKey
//Xceed.Wpf.Toolkit.Licenser.LicenseKey = "WTK46P7AYAZU4KA2AFA";
}
}
}

View File

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media.Imaging;
namespace Karaoke_Kingpin.Converters
{
[ValueConversion(typeof(System.Drawing.Bitmap), typeof(BitmapImage))]
public class BitmapToImageSourceConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is Bitmap bitmap)
{
using (MemoryStream memory = new MemoryStream())
{
bitmap.Save(memory, System.Drawing.Imaging.ImageFormat.Png);
memory.Position = 0;
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.BeginInit();
bitmapImage.StreamSource = memory;
bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
bitmapImage.EndInit();
bitmapImage.Freeze(); // Important for use in a different thread!
return bitmapImage;
}
}
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

28
ImagePathConverter.cs Normal file
View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media.Imaging;
namespace Karaoke_Kingpin
{
public class ImagePathConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
return null;
string imagePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, value.ToString());
return new BitmapImage(new Uri(imagePath));
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

905
Index.xaml Normal file
View File

@ -0,0 +1,905 @@
<Window x:Class="Karaoke_Kingpin.Index"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Karaoke_Kingpin"
xmlns:properties="clr-namespace:Karaoke_Kingpin.Properties"
mc:Ignorable="d"
Title="Index" Height="800" Width="950"
Loaded="Window_Loaded">
<!-- 添加這一行來設置背景顏色 -->
<!-- 这里是资源定义的开始 -->
<Window.Resources>
<Style x:Key="CircularCheckBox" TargetType="{x:Type CheckBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<Grid HorizontalAlignment="Left" Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<!-- 用于圆形标记 -->
<ColumnDefinition Width="*"/>
<!-- 用于文本内容 -->
</Grid.ColumnDefinitions>
<Grid x:Name="CheckMarkGrid" Width="15" Height="15" Grid.Column="0">
<!-- 最外层的 Ellipse 作为边框 -->
<Ellipse Stroke="Black" StrokeThickness="1"
Fill="Transparent" Width="15" Height="15"/>
<!-- 第二层的 Ellipse 用作白色背景 -->
<Ellipse x:Name="BackgroundEllipse" Fill="White" StrokeThickness="0"
Width="13" Height="13" Margin="1"/>
<!-- 最内层的 Ellipse 用作填充色,初始时不可见 -->
<Ellipse x:Name="FillEllipse" Fill="Black" Visibility="Collapsed"
Width="9" Height="9" Margin="3"/>
</Grid>
<!-- ContentPresenter 放在第二列,不会被遮挡 -->
<ContentPresenter Grid.Column="1" HorizontalAlignment="Left"
Margin="4,0,0,0" VerticalAlignment="Center"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<!-- 当 CheckBox 被选中时,显示填充的 Ellipse -->
<Setter Property="Visibility" TargetName="FillEllipse" Value="Visible"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<x:Array Type="Color" x:Key="AvailableColors">
<Color>#FFA52A2A</Color>
<!-- 红色 -->
<Color>#FF008000</Color>
<!-- 绿色 -->
<Color>#FF0000FF</Color>
<!-- 蓝色 -->
<Color>#FF808080</Color>
<!-- 灰色 -->
<!-- 添加更多颜色 -->
<Color>#FFD3D3D3</Color>
</x:Array>
<DataTemplate x:Key="ColorTemplate">
<Rectangle Width="16" Height="16" Fill="{Binding}" />
</DataTemplate>
<local:ImagePathConverter x:Key="ImagePathConverter"/>
</Window.Resources>
<!-- 资源定义结束 -->
<Grid>
<TabControl>
<TabItem Header="一般設定">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="15*"/>
<!-- 顶部文字行 -->
<RowDefinition Height="85*"/>
<!-- 剩余空间分配给下面的内容 -->
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="13*"/>
<ColumnDefinition Width="87*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding Path=UserImage, Converter={StaticResource ImagePathConverter}}"
Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10"/>
<!-- 原有的 Grid 放在這裡,作為 StackPanel 的一部分 -->
<Grid Grid.Row="1" Grid.ColumnSpan="2">
<!-- 定义两个列 -->
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*" />
<!-- 这将设置第一列宽度为可用空间的 3/10 -->
<ColumnDefinition Width="6*" />
</Grid.ColumnDefinitions>
<!-- 第二個 column 的 Grid -->
<Grid Background="#F0F0F0" Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="100" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- 第二個 column 的內容 -->
<!-- 在這裡放置第二個 Column 的第一個 Row 內的控件 -->
<Grid Grid.Row="0">
<!--第二個 Column 的第一個 Row 的內容-->
<GroupBox Header="跑馬燈" Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="42"/>
<RowDefinition Height="42"/>
<RowDefinition Height="42"/>
<RowDefinition Height="42"/>
<RowDefinition Height="42"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="480"/>
<ColumnDefinition Width="120"/>
</Grid.ColumnDefinitions>
<ListBox x:Name="MarqueeListBox"
Grid.Row="0" Grid.Column="0" Grid.RowSpan="5"
HorizontalAlignment="Left" Height="210"
Margin="10,10,0,0" VerticalAlignment="Top"
Width="760" FontSize="20"
SelectionChanged="MarqueeListBox_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" TextWrapping="Wrap"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button Margin="5,5,20,5" Grid.Row="3" Grid.Column="1" Click="SendAnnouncement_Click">
<TextBlock Text="發送" FontSize="25"/>
</Button>
</Grid>
</GroupBox>
</Grid>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<!-- 目標行的實現 -->
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0">
<Label Content="對象" VerticalAlignment="Center" Margin="0,0,10,0" FontSize="25"/>
<ComboBox x:Name="RoomNumbersComboBox" Width="240" Height="40" VerticalAlignment="Center" FontSize="25"
SelectedValue="{Binding SelectedRoom, Mode=TwoWay}">
<ComboBox.ItemContainerStyle>
<Style TargetType="ComboBoxItem">
<Setter Property="FontSize" Value="25"/>
</Style>
</ComboBox.ItemContainerStyle>
</ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0">
<Label Content="顏色" VerticalAlignment="Center" Margin="0,0,10,0" FontSize="25"/>
<ComboBox x:Name="ColorComboBox" Width="240" Height="40" VerticalAlignment="Center" FontSize="25"
SelectedValue="{Binding SelectedColor, Mode=TwoWay}"
SelectedValuePath="Content">
<ComboBoxItem Content="白色" FontSize="25"/>
<ComboBoxItem Content="紅色" FontSize="25"/>
<ComboBoxItem Content="綠色" FontSize="25"/>
<ComboBoxItem Content="藍色" FontSize="25"/>
<ComboBoxItem Content="黑色" FontSize="25"/>
<!-- 添加更多選項 -->
</ComboBox>
</StackPanel>
<Button Margin="5" Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="2" Click="LoadMarqueeItem_Click">
<TextBlock Text="讀取跑馬燈資料" FontSize="25"/>
</Button>
<Button x:Name="AddDataButton" Margin="5" Grid.Row="1" Grid.Column="1">
<TextBlock Text="新增資料" FontSize="20"/>
</Button>
<Button Margin="5" Grid.Row="1" Grid.Column="3" Click="btnDeleteData_Click">
<TextBlock Text="刪除資料" FontSize="20"/>
</Button>
</Grid>
<!-- 內容標籤 -->
<Label Content="內容" HorizontalAlignment="Left" FontSize="25" Grid.Row="2"/>
<!-- 內容TextBox -->
<TextBox x:Name="ContentTextBox"
Width="550"
Height="250"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="10"
FontSize="20"
Grid.Column="1"
Grid.Row="2"
TextWrapping="Wrap"
Text="{Binding ContentText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</Grid>
</Grid>
</Grid>
</TabItem>
<TabItem Header="歌庫目錄" Height="19" VerticalAlignment="Top">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<!-- 為新的控件設置自動高度 -->
<RowDefinition Height="*"/>
<!-- 占據1/3-->
<RowDefinition Height="2*"/>
<!-- 剩餘的2/3-->
</Grid.RowDefinitions>
<!-- 新增的搜索功能部分 -->
<StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Top">
<ComboBox x:Name="searchTypeComboBox" Width="200" Margin="5" SelectionChanged="SearchTypeComboBox_SelectionChanged">
<!-- 在這裡新增 ComboBoxItem -->
<ComboBoxItem Content="編號查詢"/>
<ComboBoxItem Content="歌星查詢"/>
<ComboBoxItem Content="歌名查詢"/>
<ComboBoxItem Content="日期查詢"/>
<ComboBoxItem Content="語別查詢"/>
<!-- 更多選項... -->
</ComboBox>
<TextBox x:Name="searchTextBox" Width="500" Margin="5"/>
<Button Content="查詢" Width="100" Margin="5" Click="SearchButton_Click"/>
<Label x:Name="resultCountLabel" Content="查詢筆數: 0筆" Foreground="Blue" VerticalAlignment="Center" Margin="5"/>
</StackPanel>
<DataGrid x:Name="SongsDataGrid" AutoGenerateColumns="False" CanUserAddRows="False" Grid.Row="1" SelectionChanged="SongsDataGrid_SelectionChanged">
<DataGrid.Columns>
<DataGridTextColumn Header="歌曲編號" Binding="{Binding SongNumber}"/>
<DataGridTextColumn Header="歌曲名稱" Binding="{Binding Song}"/>
<DataGridTextColumn Header="歌星 A" Binding="{Binding ArtistA}"/>
<DataGridTextColumn Header="歌星 B" Binding="{Binding ArtistB}"/>
<DataGridTextColumn Header="路徑 1" Binding="{Binding SongFilePathHost1}"/>
<DataGridTextColumn Header="路徑 2" Binding="{Binding SongFilePathHost2}"/>
<DataGridTextColumn Header="歌曲檔名" Binding="{Binding SongFileName}"/>
<DataGridTextColumn Header="新增日期" Binding="{Binding AddedTime}"/>
<DataGridTextColumn Header="分類" Binding="{Binding Category}"/>
<DataGridTextColumn Header="歌曲注音" Binding="{Binding PhoneticNotation}"/>
<DataGridTextColumn Header="歌曲拼音" Binding="{Binding PinyinNotation}"/>
<DataGridTextColumn Header="語別" Binding="{Binding LanguageType}"/>
<DataGridTextColumn Header="點播次數" Binding="{Binding Plays}"/>
<DataGridTextColumn Header="版權01" Binding="{Binding Copyright01}"/>
<DataGridTextColumn Header="版權02" Binding="{Binding Copyright02}"/>
<DataGridTextColumn Header="版權03" Binding="{Binding Copyright03}"/>
<DataGridTextColumn Header="版權04" Binding="{Binding Copyright04}"/>
<DataGridTextColumn Header="版權05" Binding="{Binding Copyright05}"/>
<DataGridTextColumn Header="版權06" Binding="{Binding Copyright06}"/>
<DataGridTextColumn Header="狀態" Binding="{Binding Status}"/>
<!--<DataGridTextColumn Header="DB加減" Binding="{Binding DbAdjust}"/>-->
<DataGridTextColumn Header="歌名字數" Binding="{Binding SongNameLength}"/>
<DataGridTextColumn Header="人聲" Binding="{Binding Vocal}"/>
<DataGridTextColumn Header="狀態2" Binding="{Binding Status2}"/>
<DataGridTextColumn Header="情境" Binding="{Binding Situation}"/>
<DataGridTextColumn Header="歌星A注音" Binding="{Binding ArtistAPhonetic}"/>
<DataGridTextColumn Header="歌星B注音" Binding="{Binding ArtistBPhonetic}"/>
<DataGridTextColumn Header="歌星A分類" Binding="{Binding ArtistACategory}"/>
<DataGridTextColumn Header="歌星B分類" Binding="{Binding ArtistBCategory}"/>
<DataGridTextColumn Header="歌星A簡體" Binding="{Binding ArtistASimplified}"/>
<DataGridTextColumn Header="歌星B簡體" Binding="{Binding ArtistBSimplified}"/>
<DataGridTextColumn Header="歌名簡體" Binding="{Binding SongSimplified}"/>
<DataGridTextColumn Header="歌星A拼音" Binding="{Binding ArtistAPinyin}"/>
<DataGridTextColumn Header="歌星B拼音" Binding="{Binding ArtistBPinyin}"/>
</DataGrid.Columns>
</DataGrid>
<!-- 其他界面元素可以放在第二個RowDefinition中 -->
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<!-- 表單部分 -->
<ColumnDefinition Width="Auto"/>
<!-- 按鈕部分 -->
</Grid.ColumnDefinitions>
<!-- 第一列 -->
<StackPanel Grid.Column="0" Orientation="Vertical">
<StackPanel Orientation="Horizontal"><Label Content="歌曲編號" /><TextBox x:Name="txtSongNumber" Width="400" /></StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="歌曲名稱" />
<TextBox x:Name="txtSongName" Width="400" TextChanged="TxtSongName_TextChanged" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="歌星A" />
<TextBox x:Name="txtArtistA" Width="400" TextChanged="TxtArtistA_TextChanged" /></StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="歌星B" />
<TextBox x:Name="txtArtistB" Width="400" TextChanged="TxtArtistB_TextChanged" /></StackPanel>
<StackPanel Orientation="Horizontal"><Label Content="路徑01" /><TextBox x:Name="txtPath1" Width="400" /></StackPanel>
<StackPanel Orientation="Horizontal"><Label Content="路徑02" /><TextBox x:Name="txtPath2" Width="400" /></StackPanel>
<StackPanel Orientation="Horizontal"><Label Content="歌曲檔名" /><TextBox x:Name="txtSongFileName" Width="400" /></StackPanel>
<StackPanel Orientation="Horizontal"><Label Content="新增日期" /><TextBox x:Name="txtAddedDate" Width="400" /></StackPanel>
<StackPanel Orientation="Horizontal"><Label Content="分類" /><TextBox x:Name="txtCategory" Width="400" /></StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="歌曲拼音" />
<TextBox x:Name="txtSongPinyin" Width="400" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="歌曲注音" />
<TextBox x:Name="txtSongPhonetic" Width="400" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="點播次數" />
<TextBox x:Name="txtPlays" Width="400"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="歌星A注音" />
<TextBox x:Name="txtArtistAPhonetic" Width="400" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="歌星B注音" />
<TextBox x:Name="txtArtistBPhonetic" Width="400" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="歌星A分類" />
<ComboBox x:Name="artistACategoryComboBox" Width="200">
<ComboBoxItem Content="男" />
<ComboBoxItem Content="團" />
<ComboBoxItem Content="女" />
<ComboBoxItem Content="外" />
<ComboBoxItem Content="未定義" />
</ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="歌星B分類" />
<ComboBox x:Name="artistBCategoryComboBox" Width="200">
<ComboBoxItem Content="男" />
<ComboBoxItem Content="團" />
<ComboBoxItem Content="女" />
<ComboBoxItem Content="外" />
<ComboBoxItem Content="未定義" />
</ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Button Content="情歌" Width="50" Margin="10,10,5,0" Click="LoveSongButton_Click" />
<Button Content="選秀" Width="50" Margin="10,10,5,0" Click="TalentShowButton_Click" />
<Button Content="串燒" Width="50" Margin="10,10,5,0" Click="MedleyButton_Click" />
<Button Content="90年" Width="50" Margin="10,10,5,0" Click="NinetiesButton_Click" />
<Button Content="懷念" Width="50" Margin="10,10,5,0" Click="MemoriesButton_Click" />
<Button Content="大陸" Width="50" Margin="10,10,5,0" Click="MainlandButton_Click" />
<Button Content="清除" Width="50" Margin="10,10,5,0" Click="ClearButton_Click" />
</StackPanel>
</StackPanel>
<!-- 按鈕部分 -->
<StackPanel Grid.Column="1" Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label Content="DB加減" />
<TextBox x:Name="txtDbAdjust" Width="200" />
<Label Content="歌名字數" />
<TextBox x:Name="txtSongNameLength" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="版權01" />
<TextBox x:Name="txtCopyright01" Width="400" /></StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="版權02" />
<TextBox x:Name="txtCopyright02" Width="400" /></StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="版權03" />
<TextBox x:Name="txtCopyright03" Width="400" /></StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="版權04" />
<TextBox x:Name="txtCopyright04" Width="400" /></StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="版權05" />
<TextBox x:Name="txtCopyright05" Width="400" /></StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="版權06" />
<TextBox x:Name="txtCopyright06" Width="400" /></StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="語別" />
<ComboBox x:Name="languageTypeComboBox" Width="200">
<!-- 在這裡新增 ComboBoxItem -->
<ComboBoxItem>國語</ComboBoxItem>
<ComboBoxItem>台語</ComboBoxItem>
<ComboBoxItem>英文</ComboBoxItem>
<ComboBoxItem>日語</ComboBoxItem>
<ComboBoxItem>粵語</ComboBoxItem>
<ComboBoxItem>其他</ComboBoxItem>
<ComboBoxItem>韓語</ComboBoxItem>
<ComboBoxItem>越語</ComboBoxItem>
<ComboBoxItem>客語</ComboBoxItem>
</ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="狀態" />
<ComboBox x:Name="statusComboBox" Width="200">
<ComboBoxItem Content="0" />
<ComboBoxItem Content="1" />
</ComboBox>
<Label Content="狀態2" />
<ComboBox x:Name="status2ComboBox" Width="200">
<ComboBoxItem Content="0" />
<ComboBoxItem Content="1" />
</ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal">
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="人聲" />
<ComboBox x:Name="vocalComboBox" Width="200">
<ComboBoxItem Content="0" />
<ComboBoxItem Content="1" />
</ComboBox>
<Label Content="1.有 0.無" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="情境" />
<ComboBox x:Name="situationsComboBox" Width="200">
<ComboBoxItem Content="浪漫" />
<ComboBoxItem Content="柔和" />
<ComboBoxItem Content="動感" />
<ComboBoxItem Content="明亮" />
</ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="歌星A簡體" />
<TextBox x:Name="txtArtistASimplified" Width="400" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="歌星B簡體" />
<TextBox x:Name="txtArtistBSimplified" Width="400" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="歌名簡體" />
<TextBox x:Name="txtSongSimplified" Width="400" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="歌星A拼音" />
<TextBox x:Name="txtArtistAPinyin" Width="400" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="歌星B拼音" />
<TextBox x:Name="txtArtistBPinyin" Width="400" />
</StackPanel>
<!-- 新增的按鈕水平排列 -->
<StackPanel Orientation="Horizontal">
<Button Content="注音更新" Width="133" Margin="10,10,5,0" Click="UpdatePhoneticButton_Click" />
<Button Content="儲存歌曲" Width="133" Margin="10,10,5,0" Click="SaveSongButton_Click"/>
<Button Content="刪除歌曲" Width="133" Margin="10,10,5,0" Click="DeleteSongButton_Click"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Button x:Name="exportSongsButton" Content="匯出歌庫" Click="ExportSongsButton_Click" Width="210" Margin="0,10,10,0"/>
<Button x:Name="importSongsButton" Content="匯入歌庫" Click="ImportSongsButton_Click" Width="210" Margin="10,10,5,0"/>
</StackPanel>
</StackPanel>
</Grid>
</Grid>
</TabItem>
<!--<TabItem Header="佈景主題">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="15*" />
<RowDefinition Height="85*" />
</Grid.RowDefinitions>
--><!--定义列--><!--
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
--><!--左边的图像--><!--
<ColumnDefinition Width="9*" />
--><!--剩余空间--><!--
</Grid.ColumnDefinitions>
--><!--添加图片-->
<!--<Image Source="{Binding Source={x:Static properties:Resources.images}, Converter={StaticResource BitmapToImageSourceConverter}}" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10"/>-->
<!--<Image Source="C:\Users\Administrator\KSongloverNET\images.jpg" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10"/>--><!--
<Image Source="{Binding ImagesImage, Converter={StaticResource ImagePathConverter}}" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0"/>
<TextBlock Grid.Row="0" Grid.Column="1" Text="系統支援多樣的佈景主題功能,你可以至官方佈景主題專頁進行下載,你也可以透過文件指引,並建立自定義的佈景主題並分享給同好。" Margin="10"/>
--><!--添加GroupBox来创建一个带标题和边框的区域--><!--
<GroupBox Header="佈景主題資訊" Margin="10" Grid.Row="1" Grid.ColumnSpan="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
--><!--對於其他元素--><!--
<ColumnDefinition Width="*"/>
--><!--給 ComboBox 使用,填充所有剩餘空間--><!--
<ColumnDefinition Width="170"/>
</Grid.ColumnDefinitions>
--><!--其他元素可能在第一列-->
<!--添加一个Label来显示"佈景主題"这四个字--><!--
<Label Grid.Row="0" Grid.Column="0" Content="佈景主題:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,10,0,0"/>
<ComboBox x:Name="themeSelector" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,10,10,0" SelectionChanged="themeSelector_SelectionChanged">
<ComboBoxItem Content="./themes/black" />
<ComboBoxItem Content="./themes/default" />
<ComboBoxItem Content="./themes/default.cn" />
--><!--添加更多的主題選項--><!--
</ComboBox>
<Image x:Name="themeImage" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" Height="350" Width="560" Margin="10,10" />
--><!--修改后的内部Grid添加ColumnDefinitions定义--><!--
<Grid Grid.Row="0" Grid.RowSpan="2" Grid.Column="2">
<Grid.RowDefinitions>
--><!--定义两个行--><!--
<RowDefinition Height="30"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
--><!--定义两个列,第一个用于可能的未来使用,第二个用于显示"更多主題..."的TextBox--><!--
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
--><!--设置Grid.Column确保"更多主題..."显示在第二列--><!--
<TextBlock Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center">
<Hyperlink NavigateUri="http://example.com">更多主題...</Hyperlink>
</TextBlock>
<Label Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top" Foreground="Blue">點播台字型調整:</Label>
--><!--<xctk:IntegerUpDown x:Name="txtDianBoTaiFontAdjust"
Value="0"
Increment="2"
Minimum="-8"
Maximum="8"
Grid.Column="1"
Grid.Row="1"
Grid.RowSpan="2"
VerticalAlignment="Top"
HorizontalAlignment="Stretch"/>--><!--
<Label Grid.Column="0" Grid.Row="2" HorizontalAlignment="Left" Foreground="Blue">播放台字型調整:</Label>
--><!--<xctk:IntegerUpDown x:Name="txtBoFangTaiFontAdjust"
Value="0"
Increment="2"
Minimum="-8"
Maximum="8"
Grid.Column="1"
Grid.Row="2"
Grid.RowSpan="2"
VerticalAlignment="Top"
HorizontalAlignment="Stretch"/>--><!--
</Grid>
<GroupBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Header="內定字型設定(只影響佈景主題中未設定字型元件)">
<Grid>
--><!--Default Font Settings--><!--
<TextBlock FontFamily="Arial" VerticalAlignment="Center">Ariel; 26; white</TextBlock>
--><!--Button on the Right Side--><!--
<Button HorizontalAlignment="Right" Content="設定..." Width="60"/>
</Grid>
</GroupBox>
</Grid>
</GroupBox>
</Grid>
</TabItem>-->
<!--<TabItem Header="進階腳本">
--><!-- 進階腳本的內容 --><!--
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
--><!-- 其他行定義 --><!--
<RowDefinition Height="8*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="15*"/>
<ColumnDefinition Width="85*"/>
</Grid.ColumnDefinitions>
<Image Source="C:\Users\Administrator\KSongloverNET\script.jpg" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10"/>
--><!-- 上面一排文字 --><!--
<TextBlock Grid.Column="1" Text="此設定主要用於系統執行時將執行的初始化命令,你可以自行新增及刪除要執行的命令,也可進行其執行的先後順序,請確保其命令可正常執行,否則可能會造成程式異常,請小心設定。"
Margin="10"
VerticalAlignment="Top"
HorizontalAlignment="Left"
TextWrapping="Wrap"/>
</Grid>
--><!-- 下面的大方框、文字、和按鈕 --><!--
<Grid Grid.Row="1" Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="9*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
--><!-- 上面一行文字 --><!--
<TextBlock Grid.Row="0" Text="初始化腳本命令:" Margin="0 0 0 10" Foreground="Blue" />
--><!-- 下面的大方框可以輸入文字 --><!--
<TextBox Grid.Row="1" Grid.Column="0" Grid.RowSpan="5" Width="Auto" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto">
mkdir c:\video
</TextBox>
--><!-- 新增按鈕 --><!--
<Button Grid.Row="1" Grid.Column="1" Content="新增" Height="20" Margin="4,0,4,0" />
--><!-- 刪除按鈕 --><!--
<Button Grid.Row="2" Grid.Column="1" Content="刪除" Height="20" VerticalAlignment="Top" Margin="4,4,4,0" />
--><!-- 向上移動按鈕 --><!--
<Button Grid.Row="3" Grid.Column="1" Content="向上移動" Height="20" VerticalAlignment="Top" Margin="4,4,4,0" />
--><!-- 向下移動按鈕 --><!--
<Button Grid.Row="4" Grid.Column="1" Content="向下移動" Height="20" VerticalAlignment="Top" Margin="4,4,4,0" />
--><!-- 編輯按鈕 --><!--
<Button Grid.Row="5" Grid.Column="1" Content="編輯..." Height="20" VerticalAlignment="Top" Margin="4,4,4,0" />
--><!-- 复选框 --><!--
<CheckBox Grid.Row="6" Grid.Column="0" Margin="0,10,0,0" Content="執行時顯示視窗(通常為除錯使用)" VerticalAlignment="Top" Foreground="Blue"/>
</Grid>
</Grid>
</TabItem>-->
<TabItem Header="除錯">
<!-- 除錯的內容 -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="20*"/>
<!-- 其他行定義 -->
<RowDefinition Height="72*"/>
<RowDefinition Height="8*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="15*"/>
<ColumnDefinition Width="85*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding Path=BugImage, Converter={StaticResource ImagePathConverter}}"
Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10"/>
<!-- 上面一排文字 -->
<TextBlock Grid.Row="0" Grid.Column="1" Text="如果發生一些異常狀態你可以嘗試將偵錯模式打開系統將自動生成作業日誌檔以利進行錯誤排除你也可將此日誌檔傳送給官方參考讓K歌情人更加完美。"
Margin="10"
VerticalAlignment="Top"
HorizontalAlignment="Left"
TextWrapping="Wrap"/>
<GroupBox Grid.Row="1" Grid.ColumnSpan="2" Header="偵錯模式" Margin="10">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Margin="5,5,0,0" FontSize="22" FontWeight="Bold">顯示各個log檔案連接點選後可以開啟查看 例如下方圖示 所有功能的記錄均在此</TextBlock>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Grid.Row="1" Grid.Column="0" Margin="10" Click="SongSelectionError_Click">點歌錯誤</Button>
<!--<Button Grid.Row="1" Grid.Column="1" Margin="10" Click="LoginError_Click">登入錯誤</Button>-->
<!--<Button Grid.Row="1" Grid.Column="2" Margin="10" Click="PlaybackFailure_Click">播放失敗</Button>-->
<Button Grid.Row="1" Grid.Column="1" Margin="10" Click="SystemException_Click">系統異常</Button>
<!-- 新增的 ComboBox -->
<ComboBox x:Name="hostComboBox" Grid.Row="1" Grid.Column="4" Margin="10" Width="150" SelectionChanged="HostComboBox_SelectionChanged"/>
</Grid>
<TextBox x:Name="systemExceptionLogTextBox" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" Margin="10" IsReadOnly="True" VerticalScrollBarVisibility="Auto" Visibility="Collapsed"/>
</Grid>
</GroupBox>
<!-- 底部的行 -->
<Border Background="WhiteSmoke" Grid.Row="2" Grid.ColumnSpan="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="80"/>
</Grid.ColumnDefinitions>
<Button Content="確定" Grid.Column="1" Margin="6"/>
<Button Content="結束" Grid.Column="2" Margin="6"/>
<Button Content="套用" Grid.Column="3" Margin="6"/>
</Grid>
</Border>
</Grid>
</TabItem>
<!--<TabItem Header="待機播放">
--><!--待機播放的內容--><!--
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="20*"/>
--><!--其他行定義--><!--
<RowDefinition Height="72*"/>
<RowDefinition Height="8*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="15*"/>
<ColumnDefinition Width="85*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding Path=FilmImage, Converter={StaticResource ImagePathConverter}}"
Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10"/>
<TextBlock Grid.Row="1" Grid.Column="1" FontSize="18" FontWeight="Bold" Text="開啟包廂時 可以預先設定播放 包廂位置 防火安全等宣傳影片或圖片資訊"
Margin="10"
VerticalAlignment="Top"
HorizontalAlignment="Left"
TextWrapping="Wrap"/>
</Grid>
<GroupBox Grid.Row="1" Header="待機播放強化功能" Margin="10">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox Grid.Row="0" Margin="10">啟用待機播放強化功能(照片功能或廣告功能)</CheckBox>
<TextBlock Grid.Row="1" Grid.Column="0" Text="選擇待播影片路徑(支援mpg, dat, avi, mvb, mkv, mp4, flv)"
Margin="2"
VerticalAlignment="Top"
HorizontalAlignment="Left"
TextWrapping="Wrap"/>
<Button Grid.Row="1" Grid.Column="1" Content="選擇..." Width="60" Margin="2" />
<TextBox x:Name="standbyPlaybackPathTextBox" IsReadOnly="True" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="2" Background="WhiteSmoke" />
</Grid>
</GroupBox>
--><!--底部的行--><!--
<Border Background="WhiteSmoke" Grid.Row="2" Grid.ColumnSpan="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="80"/>
</Grid.ColumnDefinitions>
<Button Content="確定" Grid.Column="1" Margin="6"/>
<Button Content="結束" Grid.Column="2" Margin="6"/>
<Button Content="套用" Grid.Column="3" Margin="6"/>
</Grid>
</Border>
</Grid>
</TabItem>-->
<!--<TabItem Header="快取處理">
--><!-- 快取處理的內容 --><!--
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="20*"/>
--><!-- 其他行定義 --><!--
<RowDefinition Height="72*"/>
<RowDefinition Height="8*"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="15*"/>
<ColumnDefinition Width="85*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding Path=CacheImage, Converter={StaticResource ImagePathConverter}}"
Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10"/>
<TextBlock Grid.Row="1" Grid.Column="1" FontSize="18" FontWeight="Bold" Text="預先從歌庫主機下載點播歌曲至主機 到達設定容量或重開機就清空"
Margin="10"
VerticalAlignment="Top"
HorizontalAlignment="Left"
TextWrapping="Wrap"/>
</Grid>
<GroupBox Grid.Row="1" Header="快取" Margin="10">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<CheckBox Grid.Row="0" Margin="10">啟用檔案快取機制(含雲端歌庫機制)</CheckBox>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="30"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox Grid.Row="0" Grid.Column="0" Style="{StaticResource CircularCheckBox}" Margin="10,7" Content="依容量限制" VerticalAlignment="Top"/>
--><!--<xctk:IntegerUpDown x:Name="capacityLimitUpDown"
Value="1"
Increment="1"
Minimum="1"
Maximum="100"
Grid.Column="1"
Grid.Row="0"
Grid.RowSpan="2"
Margin="0,4"
VerticalAlignment="Top"
HorizontalAlignment="Stretch"/>--><!--
<TextBlock Grid.Row="0" Grid.Column="2" VerticalAlignment="Center">GB</TextBlock>
<CheckBox Grid.Row="1" Style="{StaticResource CircularCheckBox}" Margin="10,7" Content="依百分比" />
--><!--<xctk:IntegerUpDown x:Name="percentageLimitUpDown"
Value="80"
Increment="1"
Minimum="1"
Maximum="100"
Grid.Column="1"
Grid.Row="1"
VerticalAlignment="Center"
HorizontalAlignment="Stretch"
IsEnabled="False"/>--><!--
<TextBlock Grid.Row="1" Grid.Column="2" VerticalAlignment="Center">%</TextBlock>
<Button Grid.Row="1" Grid.Column="3" Content="選擇..." Width="60" Margin="2" Click="BrowseCacheLocation_Click" HorizontalAlignment="Right" Background="Gainsboro" />
<TextBlock Grid.Row="2" Grid.Column="0"></TextBlock>
<TextBlock Grid.Row="2" Text="快取存放位置:" TextWrapping="Wrap" Margin="10,0"/>
<TextBox x:Name="cacheLocationTextBox" IsReadOnly="True" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Margin="2" Background="WhiteSmoke" />
<CheckBox Grid.Row="3" Grid.ColumnSpan="3" Margin="10">包含Youtube點播使用快取此功能啟用將降低畫質如網路速度夠快不建議啟用</CheckBox>
</Grid>
</Grid>
</GroupBox>
--><!-- 底部的行 --><!--
<Border Background="WhiteSmoke" Grid.Row="2" Grid.ColumnSpan="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="80"/>
</Grid.ColumnDefinitions>
<Button Content="確定" Grid.Column="1" Margin="6"/>
<Button Content="結束" Grid.Column="2" Margin="6"/>
<Button Content="套用" Grid.Column="3" Margin="6"/>
</Grid>
</Border>
</Grid>
</TabItem>-->
</TabControl>
</Grid>
</Window>

1590
Index.xaml.cs Normal file

File diff suppressed because it is too large Load Diff

337
Karaoke Kingpin.csproj Normal file
View File

@ -0,0 +1,337 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{47A5934C-9CE4-4930-8A3C-32ECB48B07C2}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Karaoke_Kingpin</RootNamespace>
<AssemblyName>Karaoke Kingpin</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="Chinese, Version=0.5.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Chinese.0.5.0\lib\net46\Chinese.dll</HintPath>
</Reference>
<Reference Include="ChineseConverter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9ecab500adebae88, processorArchitecture=MSIL">
<HintPath>packages\ChineseConverter.1.0.0\lib\net20\ChineseConverter.dll</HintPath>
</Reference>
<Reference Include="ChnCharInfo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=18f031bd02e5e291, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.International.Converters.PinYinConverter.1.0.0\lib\ChnCharInfo.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="EPPlus, Version=7.1.2.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
<HintPath>packages\EPPlus.7.1.2\lib\net462\EPPlus.dll</HintPath>
</Reference>
<Reference Include="EPPlus.Interfaces, Version=6.1.1.0, Culture=neutral, PublicKeyToken=a694d7f3b0907a61, processorArchitecture=MSIL">
<HintPath>packages\EPPlus.Interfaces.6.1.1\lib\net462\EPPlus.Interfaces.dll</HintPath>
</Reference>
<Reference Include="EPPlus.System.Drawing, Version=6.1.1.0, Culture=neutral, PublicKeyToken=2308d35469c9bac0, processorArchitecture=MSIL">
<HintPath>packages\EPPlus.System.Drawing.6.1.1\lib\net462\EPPlus.System.Drawing.dll</HintPath>
</Reference>
<Reference Include="ExcelDataReader, Version=3.6.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
<HintPath>packages\ExcelDataReader.3.6.0\lib\net45\ExcelDataReader.dll</HintPath>
</Reference>
<Reference Include="ExcelDataReader.DataSet, Version=3.6.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
<HintPath>packages\ExcelDataReader.DataSet.3.6.0\lib\net35\ExcelDataReader.DataSet.dll</HintPath>
</Reference>
<Reference Include="FirstFloor.ModernUI, Version=1.0.9.0, Culture=neutral, PublicKeyToken=bc9b0c37bf06c6a9, processorArchitecture=MSIL">
<HintPath>packages\ModernUI.WPF.1.0.9\lib\net45\FirstFloor.ModernUI.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Sqlite, Version=8.0.4.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Data.Sqlite.Core.8.0.4\lib\netstandard2.0\Microsoft.Data.Sqlite.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IO.RecyclableMemoryStream, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.IO.RecyclableMemoryStream.3.0.0\lib\netstandard2.0\Microsoft.IO.RecyclableMemoryStream.dll</HintPath>
</Reference>
<Reference Include="ModernUI.Xceed.AvalonDock, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\SamOatesGames.ModernUI.Xceed.Toolkit.1.0.1905191936\lib\net45\ModernUI.Xceed.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="ModernUI.Xceed.Toolkit, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\SamOatesGames.ModernUI.Xceed.Toolkit.1.0.1905191936\lib\net45\ModernUI.Xceed.Toolkit.dll</HintPath>
</Reference>
<Reference Include="NStandard, Version=0.63.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\NStandard.0.63.2\lib\net48\NStandard.dll</HintPath>
</Reference>
<Reference Include="Pinyin4net, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\pinyin4net.1.0.0\lib\net40\Pinyin4net.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.batteries_v2, Version=2.1.8.2226, Culture=neutral, PublicKeyToken=8226ea5df37bcae9, processorArchitecture=MSIL">
<HintPath>packages\SQLitePCLRaw.bundle_e_sqlite3.2.1.8\lib\net461\SQLitePCLRaw.batteries_v2.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.core, Version=2.1.8.2226, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
<HintPath>packages\SQLitePCLRaw.core.2.1.8\lib\netstandard2.0\SQLitePCLRaw.core.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.provider.dynamic_cdecl, Version=2.1.8.2226, Culture=neutral, PublicKeyToken=b68184102cba0b3b, processorArchitecture=MSIL">
<HintPath>packages\SQLitePCLRaw.provider.dynamic_cdecl.2.1.8\lib\netstandard2.0\SQLitePCLRaw.provider.dynamic_cdecl.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.ComponentModel.Annotations.5.0.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.SQLite, Version=1.0.118.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\lib\net46\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Data.SQLite.EF6, Version=1.0.118.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>packages\System.Data.SQLite.EF6.1.0.118.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
</Reference>
<Reference Include="System.Data.SQLite.Linq, Version=1.0.118.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>packages\System.Data.SQLite.Linq.1.0.118.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Security" />
<Reference Include="System.Text.Encoding.CodePages, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Text.Encoding.CodePages.8.0.0\lib\net462\System.Text.Encoding.CodePages.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=4.6.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.4.6.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=4.6.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.4.6.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.FluentDesign, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.AvalonDock.Themes.FluentDesign.4.6.24151.1544\lib\net40\Xceed.Wpf.AvalonDock.Themes.FluentDesign.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.MaterialDesign, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.AvalonDock.Themes.MaterialDesign.4.6.24151.1544\lib\net40\Xceed.Wpf.AvalonDock.Themes.MaterialDesign.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=4.6.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.4.6.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.MetroAccent, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.AvalonDock.Themes.MetroAccent.4.6.24151.1544\lib\net40\Xceed.Wpf.AvalonDock.Themes.MetroAccent.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Office2007, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.AvalonDock.Themes.Office2007.4.6.24151.1544\lib\net40\Xceed.Wpf.AvalonDock.Themes.Office2007.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=4.6.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.4.6.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Windows10, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.AvalonDock.Themes.Windows10.4.6.24151.1544\lib\net40\Xceed.Wpf.AvalonDock.Themes.Windows10.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.DataGrid, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.DataGrid.Toolkit.4.6.24151.1544\lib\net40\Xceed.Wpf.DataGrid.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.DataGrid.Themes.FluentDesign, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.DataGrid.Themes.FluentDesign.4.6.24151.1544\lib\net40\Xceed.Wpf.DataGrid.Themes.FluentDesign.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.DataGrid.Themes.MaterialDesign, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.DataGrid.Themes.MaterialDesign.4.6.24151.1544\lib\net40\Xceed.Wpf.DataGrid.Themes.MaterialDesign.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.DataGrid.Themes.Metro, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.DataGrid.Themes.Metro.4.6.24151.1544\lib\net40\Xceed.Wpf.DataGrid.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.DataGrid.Themes.Office2007, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.DataGrid.Themes.Office2007.4.6.24151.1544\lib\net40\Xceed.Wpf.DataGrid.Themes.Office2007.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.DataGrid.Themes.Windows10, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.DataGrid.Themes.Windows10.4.6.24151.1544\lib\net40\Xceed.Wpf.DataGrid.Themes.Windows10.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.ListBox, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.ListBox.4.6.24151.1544\lib\net40\Xceed.Wpf.ListBox.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.ListBox.Themes.FluentDesign, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.ListBox.Themes.FluentDesign.4.6.24151.1544\lib\net40\Xceed.Wpf.ListBox.Themes.FluentDesign.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.ListBox.Themes.LiveExplorer, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.ListBox.Themes.LiveExplorer.4.6.24151.1544\lib\net40\Xceed.Wpf.ListBox.Themes.LiveExplorer.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.ListBox.Themes.MaterialDesign, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.ListBox.Themes.MaterialDesign.4.6.24151.1544\lib\net40\Xceed.Wpf.ListBox.Themes.MaterialDesign.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.ListBox.Themes.Metro, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.ListBox.Themes.Metro.4.6.24151.1544\lib\net40\Xceed.Wpf.ListBox.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.ListBox.Themes.Office2007, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.ListBox.Themes.Office2007.4.6.24151.1544\lib\net40\Xceed.Wpf.ListBox.Themes.Office2007.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.ListBox.Themes.Windows10, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.ListBox.Themes.Windows10.4.6.24151.1544\lib\net40\Xceed.Wpf.ListBox.Themes.Windows10.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.ListBox.Themes.WMP11, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.ListBox.Themes.WMP11.4.6.24151.1544\lib\net40\Xceed.Wpf.ListBox.Themes.WMP11.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Themes, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.Themes.4.6.24151.1544\lib\net40\Xceed.Wpf.Themes.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Themes.FluentDesign, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.Themes.FluentDesign.4.6.24151.1544\lib\net40\Xceed.Wpf.Themes.FluentDesign.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Themes.MaterialDesign, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.Themes.MaterialDesign.4.6.24151.1544\lib\net40\Xceed.Wpf.Themes.MaterialDesign.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Themes.MaterialDesignColors, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.Themes.MaterialDesignColors.4.6.24151.1544\lib\net40\Xceed.Wpf.Themes.MaterialDesignColors.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Themes.Metro, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.Themes.Metro.4.6.24151.1544\lib\net40\Xceed.Wpf.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Themes.Office2007, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.Themes.Office2007.4.6.24151.1544\lib\net40\Xceed.Wpf.Themes.Office2007.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Themes.Windows10, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.Themes.Windows10.4.6.24151.1544\lib\net40\Xceed.Wpf.Themes.Windows10.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.Toolkit.4.6.24151.1544\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit.Themes.FluentDesign, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.Toolkit.Themes.FluentDesign.4.6.24151.1544\lib\net40\Xceed.Wpf.Toolkit.Themes.FluentDesign.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit.Themes.MaterialDesign, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.Toolkit.Themes.MaterialDesign.4.6.24151.1544\lib\net40\Xceed.Wpf.Toolkit.Themes.MaterialDesign.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit.Themes.Metro, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.Toolkit.Themes.Metro.4.6.24151.1544\lib\net40\Xceed.Wpf.Toolkit.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit.Themes.Office2007, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.Toolkit.Themes.Office2007.4.6.24151.1544\lib\net40\Xceed.Wpf.Toolkit.Themes.Office2007.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit.Themes.Windows10, Version=4.6.24151.15440, Culture=neutral, PublicKeyToken=ba83ff368b7563c6, processorArchitecture=MSIL">
<HintPath>packages\Xceed.Wpf.Toolkit.Themes.Windows10.4.6.24151.1544\lib\net40\Xceed.Wpf.Toolkit.Themes.Windows10.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="ImagePathConverter.cs" />
<Compile Include="SongData.cs" />
<Page Include="Index.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="BitmapToImageSourceConverter.cs" />
<Compile Include="Index.xaml.cs">
<DependentUpon>Index.xaml</DependentUpon>
</Compile>
<Compile Include="MainViewModel.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="PinyinToZhuyinConverter.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="images.jpg" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>此專案參考這部電腦上所缺少的 NuGet 套件。請啟用 NuGet 套件還原,以下載該套件。如需詳細資訊,請參閱 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的檔案是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
<Error Condition="!Exists('packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
<Error Condition="!Exists('packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets'))" />
</Target>
<Import Project="packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
<Import Project="packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets" Condition="Exists('packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.118.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" />
</Project>

30
Karaoke Kingpin.sln Normal file
View File

@ -0,0 +1,30 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34701.34
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Karaoke Kingpin", "Karaoke Kingpin.csproj", "{47A5934C-9CE4-4930-8A3C-32ECB48B07C2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "方案項目", "方案項目", "{7577A736-C9C8-4310-9F64-AE7A1DDE83AA}"
ProjectSection(SolutionItems) = preProject
images.jpg = images.jpg
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{47A5934C-9CE4-4930-8A3C-32ECB48B07C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{47A5934C-9CE4-4930-8A3C-32ECB48B07C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47A5934C-9CE4-4930-8A3C-32ECB48B07C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{47A5934C-9CE4-4930-8A3C-32ECB48B07C2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7D5FFF8D-313E-4A42-B5E4-BED307EA8C66}
EndGlobalSection
EndGlobal

202
MainViewModel.cs Normal file
View File

@ -0,0 +1,202 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO; // 添加這行
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Karaoke_Kingpin
{
public class MainViewModel : INotifyPropertyChanged
{
private string _cacheImage;
private string _filmImage;
private string _bugImage;
private string _userImage;
private string _imagesImage;
private ObservableCollection<string> _marquee1Items;
private ObservableCollection<string> _marquee2Items;
private string selectedRoom;
private string selectedColor;
private string contentText;
public string CacheImage
{
get { return _cacheImage; }
set
{
_cacheImage = value;
OnPropertyChanged(nameof(CacheImage));
}
}
public string FilmImage
{
get { return _filmImage; }
set
{
_filmImage = value;
OnPropertyChanged(nameof(FilmImage));
}
}
public string BugImage
{
get { return _bugImage; }
set
{
_bugImage = value;
OnPropertyChanged(nameof(BugImage));
}
}
public string UserImage
{
get { return _userImage; }
set
{
_userImage = value;
OnPropertyChanged(nameof(UserImage));
}
}
public string ImagesImage
{
get { return _imagesImage; }
set
{
_imagesImage = value;
OnPropertyChanged(nameof(ImagesImage));
}
}
public ObservableCollection<string> Marquee1Items
{
get { return _marquee1Items; }
set
{
_marquee1Items = value;
OnPropertyChanged(nameof(Marquee1Items));
}
}
public ObservableCollection<string> Marquee2Items
{
get { return _marquee2Items; }
set
{
_marquee2Items = value;
OnPropertyChanged(nameof(Marquee2Items));
}
}
public string SelectedRoom
{
get => selectedRoom;
set
{
if (selectedRoom != value)
{
selectedRoom = value;
OnPropertyChanged();
UpdateContentTextRoom();
}
}
}
public string SelectedColor
{
get => selectedColor;
set
{
if (selectedColor != value)
{
selectedColor = value;
OnPropertyChanged();
UpdateContentTextColor();
}
}
}
public string ContentText
{
get => contentText;
set
{
if (contentText != value)
{
contentText = value;
OnPropertyChanged();
}
}
}
public MainViewModel()
{
// Initialize with the image filename
CacheImage = "cache.jpg";
FilmImage = "film.jpg";
BugImage = "bug.jpg";
UserImage = "user.jpg";
ImagesImage = "images.jpg";
// Initialize Marquee Items
Marquee1Items = new ObservableCollection<string>(File.ReadAllLines(@"txt\marquee1_items.txt"));
Marquee2Items = new ObservableCollection<string>(File.ReadAllLines(@"txt\marquee2_items.txt"));
}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
private void UpdateContentTextColor()
{
if (!string.IsNullOrEmpty(ContentText) && ContentText.Length >= 5)
{
// 正则表达式模式,匹配"全部"或4位数字 + 颜色 + "-"
string pattern = @"^(全部|\d{4})\((白色|紅色|綠色|黑色|藍色)\)-";
Match match = Regex.Match(ContentText, pattern);
if (match.Success)
{
// 提取颜色部分
string colorName = selectedColor;
// 构建新的 ContentText只在右边添加括号
ContentText = ContentText.Substring(0, match.Groups[1].Length + 1) +
colorName +
")" +
ContentText.Substring(match.Groups[1].Length + 1 + colorName.Length + 1);
// 通知 ContentText 属性已更新
OnPropertyChanged(nameof(ContentText));
}
}
}
private void UpdateContentTextRoom()
{
if (!string.IsNullOrEmpty(ContentText) && !string.IsNullOrEmpty(SelectedRoom))
{
// 正则表达式模式,匹配"全部"或4位数字 + 颜色 + "-"
string pattern = @"^(全部|\d{4})\((白色|紅色|綠色|黑色|藍色)\)-";
Match match = Regex.Match(ContentText, pattern);
if (match.Success)
{
// 构建新的 ContentText将 "全部" 或房号替换为 SelectedRoom
ContentText = SelectedRoom + ContentText.Substring(match.Groups[1].Length);
// 通知 ContentText 属性已更新
OnPropertyChanged(nameof(ContentText));
}
}
}
}
}

48
MainWindow.xaml Normal file
View File

@ -0,0 +1,48 @@
<Window x:Class="Karaoke_Kingpin.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Karaoke_Kingpin"
mc:Ignorable="d"
Title="卡拉OK後台管理系統設定" Height="600" Width="900">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="卡拉OK後台管理系統" FontSize="18" HorizontalAlignment="Center"></TextBlock>
<StackPanel Grid.Row="1" Grid.Column="0" Background="#0078d4">
<TextBlock Text="登錄" FontSize="22" HorizontalAlignment="Center" Foreground="White" Margin="5"></TextBlock>
</StackPanel>
<Grid Grid.Row="3" HorizontalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="200"/>
</Grid.ColumnDefinitions>
<TextBlock Text="帳號" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"/>
<TextBox x:Name="txtUserName" Grid.Row="0" Grid.Column="1" Margin="2"/>
<TextBlock Text="密碼" Grid.Row="1" VerticalAlignment="Center"/>
<TextBox x:Name="txtPassword" KeyDown="PasswordBox_KeyDown" Grid.Row="1" Grid.Column="1" Margin="2"/>
<CheckBox Grid.ColumnSpan="2" Content="記住密碼" Grid.Row="2"/>
<Button Grid.Row="3" Grid.ColumnSpan="2" Content="登錄" Click="Button_Click"/>
</Grid>
</Grid>
</Window>

103
MainWindow.xaml.cs Normal file
View File

@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Karaoke_Kingpin
{
/// <summary>
/// MainWindow.xaml 的互動邏輯
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
AttemptLogin();
}
private void PasswordBox_KeyDown(object sender, KeyEventArgs e)
{
// 檢查是否按下 Enter 鍵
if (e.Key == Key.Enter)
{
AttemptLogin();
}
}
private void AttemptLogin()
{
string userName = txtUserName.Text;
string password = txtPassword.Text;
string hashedPassword = HashHelper.ComputeSha256Hash(password);
string storedHashedPassword = "05e8335be671f28dbeeca81756ee91c4c9aa3917fb6c50a326c2d58ce91bd6eb";
if (userName == "262622584" && hashedPassword == storedHashedPassword)
{
Index index = new Index();
index.Show();
this.Close();
}
else
{
MessageBox.Show("輸入用戶名或密碼不正確");
}
}
}
public static class HashHelper
{
public static string ComputeSha256Hash(string rawData)
{
// 使用SHA256
using (SHA256 sha256Hash = SHA256.Create())
{
// 计算输入字符串的哈希值
byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(rawData));
// 将字节数组转换为字符串
StringBuilder builder = new StringBuilder();
for (int i = 0; i < bytes.Length; i++)
{
builder.Append(bytes[i].ToString("x2"));
}
return builder.ToString();
}
}
}
public class ColorToSolidColorBrushConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is Color color)
{
return new SolidColorBrush(color);
}
return DependencyProperty.UnsetValue;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

139
PinyinToZhuyinConverter.cs Normal file
View File

@ -0,0 +1,139 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Karaoke_Kingpin
{
public static class PinyinToZhuyinConverter
{
private static readonly Dictionary<string, string> PinyinToZhuyinMap = new Dictionary<string, string>
{
{ "a", "ㄚ" }, { "o", "ㄛ" }, { "e", "ㄜ" }, { "ai", "ㄞ" }, { "ei", "ㄟ" },
{ "ao", "ㄠ" }, { "ou", "ㄡ" }, { "an", "ㄢ" }, { "en", "ㄣ" }, { "ang", "ㄤ" },
{ "eng", "ㄥ" }, { "yi", "ㄧ" }, { "ya", "ㄧㄚ" }, { "yo", "ㄧㄛ" }, { "ye", "ㄧㄝ" },
{ "yai", "ㄧㄞ" }, { "yao", "ㄧㄠ" }, { "you", "ㄧㄡ" }, { "yan", "ㄧㄢ" }, { "yin", "ㄧㄣ" },
{ "yang", "ㄧㄤ" }, { "ying", "ㄧㄥ" }, { "wu", "ㄨ" }, { "wa", "ㄨㄚ" }, { "wo", "ㄨㄛ" },
{ "wai", "ㄨㄞ" }, { "wei", "ㄨㄟ" }, { "wan", "ㄨㄢ" }, { "wen", "ㄨㄣ" }, { "wang", "ㄨㄤ" },
{ "weng", "ㄨㄥ" }, { "yu", "ㄩ" }, { "yue", "ㄩㄝ" }, { "yuan", "ㄩㄢ" }, { "yun", "ㄩㄣ" },
{ "ba", "ㄅㄚ" }, { "bo", "ㄅㄛ" }, { "bai", "ㄅㄞ" }, { "bei", "ㄅㄟ" }, { "bao", "ㄅㄠ" },
{ "ban", "ㄅㄢ" }, { "ben", "ㄅㄣ" }, { "bang", "ㄅㄤ" }, { "beng", "ㄅㄥ" }, { "bi", "ㄅㄧ" },
{ "bie", "ㄅㄧㄝ" }, { "biao", "ㄅㄧㄠ" }, { "bian", "ㄅㄧㄢ" }, { "bin", "ㄅㄧㄣ" }, { "bing", "ㄅㄧㄥ" },
{ "bu", "ㄅㄨ" }, { "pa", "ㄆㄚ" }, { "po", "ㄆㄛ" }, { "pai", "ㄆㄞ" }, { "pei", "ㄆㄟ" },
{ "pao", "ㄆㄠ" }, { "pou", "ㄆㄡ" }, { "pan", "ㄆㄢ" }, { "pen", "ㄆㄣ" }, { "pang", "ㄆㄤ" },
{ "peng", "ㄆㄥ" }, { "pi", "ㄆㄧ" }, { "pie", "ㄆㄧㄝ" }, { "piao", "ㄆㄧㄠ" }, { "pian", "ㄆㄧㄢ" },
{ "pin", "ㄆㄧㄣ" }, { "ping", "ㄆㄧㄥ" }, { "pu", "ㄆㄨ" }, { "ma", "ㄇㄚ" }, { "mo", "ㄇㄛ" },
{ "me", "ㄇㄜ" }, { "mai", "ㄇㄞ" }, { "mei", "ㄇㄟ" }, { "mao", "ㄇㄠ" }, { "mou", "ㄇㄡ" },
{ "man", "ㄇㄢ" }, { "men", "ㄇㄣ" }, { "mang", "ㄇㄤ" }, { "meng", "ㄇㄥ" }, { "mi", "ㄇㄧ" },
{ "mie", "ㄇㄧㄝ" }, { "miao", "ㄇㄧㄠ" }, { "mian", "ㄇㄧㄢ" }, { "min", "ㄇㄧㄣ" }, { "ming", "ㄇㄧㄥ" },
{ "mu", "ㄇㄨ" }, { "fa", "ㄈㄚ" }, { "fo", "ㄈㄛ" }, { "fei", "ㄈㄟ" }, { "fou", "ㄈㄡ" },
{ "fan", "ㄈㄢ" }, { "fen", "ㄈㄣ" }, { "fang", "ㄈㄤ" }, { "feng", "ㄈㄥ" }, { "fu", "ㄈㄨ" },
{ "da", "ㄉㄚ" }, { "de", "ㄉㄜ" }, { "dai", "ㄉㄞ" }, { "dei", "ㄉㄟ" }, { "dao", "ㄉㄠ" },
{ "dou", "ㄉㄡ" }, { "dan", "ㄉㄢ" }, { "den", "ㄉㄣ" }, { "dang", "ㄉㄤ" }, { "deng", "ㄉㄥ" },
{ "di", "ㄉㄧ" }, { "die", "ㄉㄧㄝ" }, { "diao", "ㄉㄧㄠ" }, { "diu", "ㄉㄧㄡ" }, { "dian", "ㄉㄧㄢ" },
{ "ding", "ㄉㄧㄥ" }, { "du", "ㄉㄨ" }, { "duo", "ㄉㄨㄛ" }, { "dui", "ㄉㄨㄟ" }, { "duan", "ㄉㄨㄢ" },
{ "dun", "ㄉㄨㄣ" }, { "dong", "ㄉㄨㄥ" }, { "ta", "ㄊㄚ" }, { "te", "ㄊㄜ" }, { "tai", "ㄊㄞ" },
{ "tao", "ㄊㄠ" }, { "tou", "ㄊㄡ" }, { "tan", "ㄊㄢ" }, { "tang", "ㄊㄤ" }, { "teng", "ㄊㄥ" },
{ "ti", "ㄊㄧ" }, { "tie", "ㄊㄧㄝ" }, { "tiao", "ㄊㄧㄠ" }, { "tian", "ㄊㄧㄢ" }, { "ting", "ㄊㄧㄥ" },
{ "tu", "ㄊㄨ" }, { "tuo", "ㄊㄨㄛ" }, { "tui", "ㄊㄨㄟ" }, { "tuan", "ㄊㄨㄢ" }, { "tun", "ㄊㄨㄣ" },
{ "tong", "ㄊㄨㄥ" }, { "na", "ㄋㄚ" }, { "ne", "ㄋㄜ" }, { "nai", "ㄋㄞ" }, { "nei", "ㄋㄟ" },
{ "nao", "ㄋㄠ" }, { "nou", "ㄋㄡ" }, { "nan", "ㄋㄢ" }, { "nen", "ㄋㄣ" }, { "nang", "ㄋㄤ" },
{ "neng", "ㄋㄥ" }, { "ni", "ㄋㄧ" }, { "nie", "ㄋㄧㄝ" }, { "niao", "ㄋㄧㄠ" }, { "niu", "ㄋㄧㄡ" },
{ "nian", "ㄋㄧㄢ" }, { "nin", "ㄋㄧㄣ" }, { "niang", "ㄋㄧㄤ" }, { "ning", "ㄋㄧㄥ" }, { "nu", "ㄋㄨ" },
{ "nuo", "ㄋㄨㄛ" }, { "nuan", "ㄋㄨㄢ" }, { "nun", "ㄋㄨㄣ" }, { "nong", "ㄋㄨㄥ" }, { "nv", "ㄋㄩ" },
{ "nue", "ㄋㄩㄝ" },
{ "la", "ㄌㄚ" }, { "le", "ㄌㄜ" }, { "lai", "ㄌㄞ" }, { "lei", "ㄌㄟ" },
{ "lao", "ㄌㄠ" }, { "lou", "ㄌㄡ" }, { "lan", "ㄌㄢ" }, { "lang", "ㄌㄤ" }, { "leng", "ㄌㄥ" },
{ "li", "ㄌㄧ" }, { "lia", "ㄌㄧㄚ" }, { "lie", "ㄌㄧㄝ" }, { "liao", "ㄌㄧㄠ" },
{ "liu", "ㄌㄧㄡ" }, { "lian", "ㄌㄧㄢ" }, { "lin", "ㄌㄧㄣ" }, { "liang", "ㄌㄧㄤ" }, { "ling", "ㄌㄧㄥ" },
{ "lu", "ㄌㄨ" }, { "luo", "ㄌㄨㄛ" }, { "luan", "ㄌㄨㄢ" }, { "lun", "ㄌㄨㄣ" }, { "long", "ㄌㄨㄥ" },
{ "lv", "ㄌㄩ" }, { "lve", "ㄌㄩㄝ" },
{ "ga", "ㄍㄚ" }, { "ge", "ㄍㄜ" }, { "gai", "ㄍㄞ" }, { "gei", "ㄍㄟ" },
{ "gao", "ㄍㄠ" }, { "gou", "ㄍㄡ" }, { "gan", "ㄍㄢ" }, { "gen", "ㄍㄣ" }, { "gang", "ㄍㄤ" },
{ "geng", "ㄍㄥ" }, { "gu", "ㄍㄨ" }, { "gua", "ㄍㄨㄚ" }, { "guo", "ㄍㄨㄛ" },
{ "guai", "ㄍㄨㄞ" }, { "gui", "ㄍㄨㄟ" }, { "guan", "ㄍㄨㄢ" }, { "gun", "ㄍㄨㄣ" }, { "guang", "ㄍㄨㄤ" },
{ "gong", "ㄍㄨㄥ" },
{ "ka", "ㄎㄚ" }, { "ke", "ㄎㄜ" }, { "kai", "ㄎㄞ" }, { "kei", "ㄎㄟ" },
{ "kao", "ㄎㄠ" }, { "kou", "ㄎㄡ" }, { "kan", "ㄎㄢ" }, { "ken", "ㄎㄣ" }, { "kang", "ㄎㄤ" },
{ "keng", "ㄎㄥ" }, { "ku", "ㄎㄨ" }, { "kua", "ㄎㄨㄚ" }, { "kuo", "ㄎㄨㄛ" },
{ "kuai", "ㄎㄨㄞ" }, { "kui", "ㄎㄨㄟ" }, { "kuan", "ㄎㄨㄢ" }, { "kun", "ㄎㄨㄣ" }, { "kuang", "ㄎㄨㄤ" },
{ "kong", "ㄎㄨㄥ" },
{ "ha", "ㄏㄚ" }, { "he", "ㄏㄜ" }, { "hai", "ㄏㄞ" }, { "hei", "ㄏㄟ" },
{ "hao", "ㄏㄠ" }, { "hou", "ㄏㄡ" }, { "han", "ㄏㄢ" }, { "hen", "ㄏㄣ" }, { "hang", "ㄏㄤ" },
{ "heng", "ㄏㄥ" }, { "hu", "ㄏㄨ" }, { "hua", "ㄏㄨㄚ" }, { "huo", "ㄏㄨㄛ" },
{ "huai", "ㄏㄨㄞ" }, { "hui", "ㄏㄨㄟ" }, { "huan", "ㄏㄨㄢ" }, { "hun", "ㄏㄨㄣ" }, { "huang", "ㄏㄨㄤ" },
{ "hong", "ㄏㄨㄥ" },
{ "ji", "ㄐ一" }, { "jia", "ㄐㄧㄚ" }, { "jie", "ㄐㄧㄝ" }, { "jiao", "ㄐㄧㄠ" },
{ "jiu", "ㄐ一ㄡ" }, { "jian", "ㄐ一ㄢ" }, { "jin", "ㄐ一ㄣ" }, { "jiang", "ㄐ一ㄤ" }, { "jing", "ㄐ一ㄥ" },
{ "ju", "ㄐㄩ" }, { "jue", "ㄐㄩㄝ" }, { "juan", "ㄐㄩㄢ" }, { "jun", "ㄐㄩㄣ" },
{ "jiong", "ㄐㄩㄥ" },
{ "qi", "ㄑ一" }, { "qia", "ㄑㄧㄚ" }, { "qie", "ㄑㄧㄝ" }, { "qiao", "ㄑㄧㄠ" },
{ "qiu", "ㄑ一ㄡ" }, { "qian", "ㄑ一ㄢ" }, { "qin", "ㄑ一ㄣ" }, { "qiang", "ㄑ一ㄤ" }, { "qing", "ㄑ一ㄥ" },
{ "qu", "ㄑㄩ" }, { "que", "ㄑㄩㄝ" }, { "quan", "ㄑㄩㄢ" }, { "qun", "ㄑㄩㄣ" },
{ "qiong", "ㄑㄩㄥ" },
{ "xi", "ㄒ一" }, { "xia", "ㄒㄧㄚ" }, { "xie", "ㄒㄧㄝ" }, { "xiao", "ㄒㄧㄠ" },
{ "xiu", "ㄒ一ㄡ" }, { "xian", "ㄒ一ㄢ" }, { "xin", "ㄒ一ㄣ" }, { "xiang", "ㄒ一ㄤ" }, { "xing", "ㄒ一ㄥ" },
{ "xu", "ㄒㄩ" }, { "xue", "ㄒㄩㄝ" }, { "xuan", "ㄒㄩㄢ" }, { "xun", "ㄒㄩㄣ" },
{ "xiong", "ㄒㄩㄥ" },
{ "zha", "ㄓㄚ" }, { "zhe", "ㄓㄜ" }, { "zhai", "ㄓㄞ" }, { "zhei", "ㄓㄟ" },
{ "zhao", "ㄓㄠ" }, { "zhou", "ㄓㄡ" }, { "zhan", "ㄓㄢ" }, { "zhen", "ㄓㄣ" }, { "zhang", "ㄓㄤ" },
{ "zheng", "ㄓㄥ" }, { "zhu", "ㄓㄨ" }, { "zhua", "ㄓㄨㄚ" }, { "zhuo", "ㄓㄨㄛ" },
{ "zhuai", "ㄓㄨㄞ" }, { "zhui", "ㄓㄨㄟ" }, { "zhuan", "ㄓㄨㄢ" }, { "zhun", "ㄓㄨㄣ" }, { "zhuang", "ㄓㄨㄤ" },
{ "zhong", "ㄓㄨㄥ" },
{ "cha", "ㄔㄚ" }, { "che", "ㄔㄜ" }, { "chai", "ㄔㄞ" }, { "chao", "ㄔㄠ" },
{ "chou", "ㄔㄡ" }, { "chan", "ㄔㄢ" }, { "chen", "ㄔㄣ" }, { "chang", "ㄔㄤ" }, { "cheng", "ㄔㄥ" },
{ "chu", "ㄔㄨ" }, { "chua", "ㄔㄨㄚ" }, { "chuo", "ㄔㄨㄛ" }, { "chuai", "ㄔㄨㄞ" }, { "chui", "ㄔㄨㄟ" },
{ "chuan", "ㄔㄨㄢ" }, { "chun", "ㄔㄨㄣ" }, { "chuang", "ㄔㄨㄤ" }, { "chong", "ㄔㄨㄥ" },
{ "sha", "ㄕㄚ" }, { "she", "ㄕㄜ" }, { "shai", "ㄕㄞ" }, { "shao", "ㄕㄠ" }, { "shou", "ㄕㄡ" },
{ "shan", "ㄕㄢ" }, { "shen", "ㄕㄣ" }, { "shang", "ㄕㄤ" }, { "sheng", "ㄕㄥ" }, { "shu", "ㄕㄨ" },
{ "shua", "ㄕㄨㄚ" }, { "shuo", "ㄕㄨㄛ" }, { "shuai", "ㄕㄨㄞ" }, { "shui", "ㄕㄨㄟ" }, { "shuan", "ㄕㄨㄢ" },
{ "shun", "ㄕㄨㄣ" }, { "shuang", "ㄕㄨㄤ" }, { "shong", "ㄕㄨㄥ" },
{ "re", "ㄖㄜ" }, { "rai", "ㄖㄞ" }, { "rao", "ㄖㄠ" }, { "rou", "ㄖㄡ" }, { "ran", "ㄖㄢ" },
{ "ren", "ㄖㄣ" }, { "rang", "ㄖㄤ" }, { "reng", "ㄖㄥ" }, { "ru", "ㄖㄨ" }, { "ruo", "ㄖㄨㄛ" },
{ "rui", "ㄖㄨㄟ" }, { "ruan", "ㄖㄨㄢ" }, { "run", "ㄖㄨㄣ" }, { "rong", "ㄖㄨㄥ" },
{ "za", "ㄗㄚ" }, { "ze", "ㄗㄜ" }, { "zai", "ㄗㄞ" }, { "zei", "ㄗㄟ" }, { "zao", "ㄗㄠ" },
{ "zou", "ㄗㄡ" }, { "zan", "ㄗㄢ" }, { "zen", "ㄗㄣ" }, { "zang", "ㄗㄤ" }, { "zeng", "ㄗㄥ" },
{ "zu", "ㄗㄨ" }, { "zuo", "ㄗㄨㄛ" }, { "zuan", "ㄗㄨㄢ" }, { "zun", "ㄗㄨㄣ" }, { "zong", "ㄗㄨㄥ" },
{ "zui", "ㄗㄨㄟ" },
{ "ca", "ㄘㄚ" }, { "ce", "ㄘㄜ" }, { "cai", "ㄘㄞ" }, { "cao", "ㄘㄠ" }, { "cou", "ㄘㄡ" },
{ "can", "ㄘㄢ" }, { "cen", "ㄘㄣ" }, { "cang", "ㄘㄤ" }, { "ceng", "ㄘㄥ" }, { "cu", "ㄘㄨ" },
{ "cuo", "ㄘㄨㄛ" }, { "cuan", "ㄘㄨㄢ" }, { "cun", "ㄘㄨㄣ" }, { "cong", "ㄘㄨㄥ" },
{ "cui", "ㄘㄨㄟ" },
{ "sa", "ㄙㄚ" }, { "se", "ㄙㄜ" }, { "sai", "ㄙㄞ" }, { "sao", "ㄙㄠ" }, { "sou", "ㄙㄡ" },
{ "san", "ㄙㄢ" }, { "sen", "ㄙㄣ" }, { "sang", "ㄙㄤ" }, { "seng", "ㄙㄥ" }, { "su", "ㄙㄨ" },
{ "suo", "ㄙㄨㄛ" }, { "suan", "ㄙㄨㄢ" }, { "sun", "ㄙㄨㄣ" }, { "song", "ㄙㄨㄥ" },
{ "sui", "ㄙㄨㄟ" },
{ "zi", "ㄗ" }, { "ci", "ㄘ" }, { "si", "ㄙ" }, { "zhi", "ㄓ" }, { "chi", "ㄔ" }, { "shi", "ㄕ" },
{ "ri", "ㄖ" },
// Add more mappings as needed
};
public static string ConvertPinyinToZhuyin(string pinyin)
{
StringBuilder zhuyin = new StringBuilder();
string[] pinyinWords = pinyin.Split(' ');
foreach (string pinyinWord in pinyinWords)
{
string key = pinyinWord; // Use the whole pinyin word
if (PinyinToZhuyinMap.TryGetValue(key, out string zhuyinSymbol))
{
zhuyin.Append(zhuyinSymbol + " ");
}
else
{
zhuyin.Append(pinyinWord + " "); // Fallback to original pinyin if not found in the map
}
}
return zhuyin.ToString().Trim(); // Trim the trailing space
}
public static bool IsZhuyin(char ch)
{
// Define the range of Unicode characters for Zhuyin
return ch >= 'ㄅ' && ch <= 'ㄩ';
}
}
}

View File

@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 組件的一般資訊是由下列的屬性集控制。
// 變更這些屬性的值即可修改組件的相關
// 資訊。
[assembly: AssemblyTitle("Karaoke Kingpin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Karaoke Kingpin")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 將 ComVisible 設為 false 可對 COM 元件隱藏
// 組件中的類型。若必須從 COM 存取此組件中的類型,
// 的類型,請在該類型上將 ComVisible 屬性設定為 true。
[assembly: ComVisible(false)]
//若要開始建置可當地語系化的應用程式,請在
//.csproj 檔案中的 <UICulture>CultureYouAreCodingWith</UICulture>
//在 <PropertyGroup> 中。例如,如果原始程式檔使用美式英文,
//請將 <UICulture> 設為 en-US。然後取消註解下列
//NeutralResourceLanguage 屬性。在下一行中更新 "en-US"
//以符合專案檔中的 UICulture 設定。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //主題特定資源字典的位置
//(在頁面中找不到時使用,
// 或應用程式資源字典中找不到資源時)
ResourceDictionaryLocation.SourceAssembly //泛型資源字典的位置
//(在頁面中找不到時使用,
// 或是應用程式或任何主題特定資源字典中找不到資源時)
)]
// 組件的版本資訊由下列四個值所組成:
//
// 主要版本
// 次要版本
// 組建編號
// 修訂
//
// 您可以指定所有的值,也可以使用 '*' 將組建和修訂編號
// 設為預設,如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

73
Properties/Resources.Designer.cs generated Normal file
View File

@ -0,0 +1,73 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 這段程式碼是由工具產生的。
// 執行階段版本:4.0.30319.42000
//
// 對這個檔案所做的變更可能會造成錯誤的行為,而且如果重新產生程式碼,
// 變更將會遺失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Karaoke_Kingpin.Properties {
using System;
/// <summary>
/// 用於查詢當地語系化字串等的強類型資源類別。
/// </summary>
// 這個類別是自動產生的,是利用 StronglyTypedResourceBuilder
// 類別透過 ResGen 或 Visual Studio 這類工具。
// 若要加入或移除成員,請編輯您的 .ResX 檔,然後重新執行 ResGen
// (利用 /str 選項),或重建您的 VS 專案。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 傳回這個類別使用的快取的 ResourceManager 執行個體。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Karaoke_Kingpin.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 覆寫目前執行緒的 CurrentUICulture 屬性,對象是所有
/// 使用這個強類型資源類別的資源查閱。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// 查詢類型 System.Drawing.Bitmap 的當地語系化資源。
/// </summary>
public static System.Drawing.Bitmap images {
get {
object obj = ResourceManager.GetObject("images", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

124
Properties/Resources.resx Normal file
View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="images" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

26
Properties/Settings.Designer.cs generated Normal file
View File

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 這段程式碼是由工具產生的。
// 執行階段版本:4.0.30319.42000
//
// 對這個檔案所做的變更可能會造成錯誤的行為,而且如果重新產生程式碼,
// 變更將會遺失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Karaoke_Kingpin.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.13.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

BIN
Resources/images.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

103
SongData.cs Normal file
View File

@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Karaoke_Kingpin
{
public class SongData
{
public string SongNumber { get; set; } // 添加歌曲编号属性
public string Song { get; set; }
public string ArtistA { get; set; }
public string ArtistB { get; set; }
public string SongFilePathHost1 { get; set; } // 添加属性以存储歌曲文件路径
public string SongFilePathHost2 { get; set; }
public string SongFileName { get; set; } // Property for the song filename
public string AddedTime { get; set; } // 新增加入时间属性
public string Category { get; set; }
public string PhoneticNotation { get; set; } // Add a new property for phonetic notation
public string PinyinNotation { get; set; } // 拼音字段
public string LanguageType { get; set; } // 歌曲的语言类别
public int Plays { get; set; }
public string Copyright01 { get; set; }
public string Copyright02 { get; set; }
public string Copyright03 { get; set; }
public string Copyright04 { get; set; }
public string Copyright05 { get; set; }
public string Copyright06 { get; set; }
public int Status { get; set; }
//public int DbAdjust { get; set; }
public int SongNameLength { get; set; }
public int Vocal { get; set; }
public int Status2 { get; set; }
public string Situation { get; set; }
public string ArtistAPhonetic { get; set; } // 新增歌手A注音
public string ArtistBPhonetic { get; set; } // 新增歌手B注音
public string ArtistACategory { get; set; }
public string ArtistBCategory { get; set; }
public string ArtistASimplified { get; set; } // 新增歌手A簡體中文
public string ArtistBSimplified { get; set; } // 新增歌手B簡體中文
public string SongSimplified { get; set; } // 新增歌曲簡體中文
public string ArtistAPinyin { get; set; } // 新增歌手A拼音
public string ArtistBPinyin { get; set; } // 新增歌手B拼音
// 更新构造函数以包括歌曲文件路径参数
// 更新构造函数以包括新参数
public SongData(
string songNumber, string song, string artistA, string artistB,
string songFilePathHost1, string songFilePathHost2, string songFileName,
string addedTime, string category, string phoneticNotation, string pinyinNotation,
string languageType, int plays,
string copyright01, string copyright02, string copyright03,
string copyright04, string copyright05, string copyright06,
int status, int songNameLength, int vocal,
int status2, string situation,
string artistAPhonetic, string artistBPhonetic, string artistACategory, string artistBCategory,
string artistASimplified, string artistBSimplified, string songSimplified, string artistAPinyin, string artistBPinyin)
{
// ...现有属性赋值...
SongNumber = songNumber;
Song = song;
ArtistA = artistA;
ArtistB = artistB;
SongFilePathHost1 = songFilePathHost1;
SongFilePathHost2 = songFilePathHost2;
SongFileName = songFileName;
AddedTime = addedTime;
Category = category;
PhoneticNotation = phoneticNotation;
PinyinNotation = pinyinNotation;
LanguageType = languageType;
Plays = plays;
// 新属性赋值
Copyright01 = copyright01;
Copyright02 = copyright02;
Copyright03 = copyright03;
Copyright04 = copyright04;
Copyright05 = copyright05;
Copyright06 = copyright06;
Status = status;
SongNameLength = songNameLength;
Vocal = vocal;
Status2 = status2;
Situation = situation;
ArtistAPhonetic = artistAPhonetic;
ArtistBPhonetic = artistBPhonetic;
ArtistACategory = artistACategory;
ArtistBCategory = artistBCategory;
ArtistASimplified = artistASimplified;
ArtistBSimplified = artistBSimplified;
SongSimplified = songSimplified;
ArtistAPinyin = artistAPinyin;
ArtistBPinyin = artistBPinyin;
}
// Adjusted ToString
public override string ToString()
{
return String.Format("Artist A: {0}, Artist B: {1}, Song: {2}", this.ArtistA, this.ArtistB, this.Song);
}
}
}

61459
SongsExport.csv Normal file

File diff suppressed because it is too large Load Diff

BIN
SongsExport.xlsx Normal file

Binary file not shown.

17
filter_columns.py Normal file
View File

@ -0,0 +1,17 @@
import pandas as pd
# 讀取Excel文件
input_file = 'SongsExport.xlsx' # 替換為你的文件名
output_file = 'SongsExport.xlsx' # 替換為你希望保存的文件名
# 使用pandas讀取Excel文件
df = pd.read_excel(input_file)
# 保留第一列和最後三列
columns_to_keep = [df.columns[0]] + df.columns[-3:].tolist()
df_filtered = df[columns_to_keep]
# 將結果保存到新的Excel文件
df_filtered.to_excel(output_file, index=False)
print(f"處理完畢,已保存到 {output_file}")

16
filter_rows.py Normal file
View File

@ -0,0 +1,16 @@
import pandas as pd
# 讀取Excel文件
input_file = 'SongsExport.xlsx' # 替換為你的文件名
output_file = 'SongsExport.xlsx' # 替換為你希望保存的文件名
# 使用pandas讀取Excel文件
df = pd.read_excel(input_file)
# 保留第一行和最後三行
rows_to_keep = pd.concat([df.head(1), df.tail(3)], ignore_index=True)
# 將結果保存到新的Excel文件
rows_to_keep.to_excel(output_file, index=False)
print(f"處理完畢,已保存到 {output_file}")

BIN
images.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

73
packages.config Normal file
View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Chinese" version="0.5.0" targetFramework="net481" />
<package id="ChineseConverter" version="1.0.0" targetFramework="net481" />
<package id="EntityFramework" version="6.4.4" targetFramework="net481" />
<package id="EPPlus" version="7.1.2" targetFramework="net481" />
<package id="EPPlus.Interfaces" version="6.1.1" targetFramework="net481" />
<package id="EPPlus.System.Drawing" version="6.1.1" targetFramework="net481" />
<package id="ExcelDataReader" version="3.6.0" targetFramework="net481" />
<package id="ExcelDataReader.DataSet" version="3.6.0" targetFramework="net481" />
<package id="Extended.Wpf.Toolkit" version="4.6.0" targetFramework="net481" />
<package id="Microsoft.Data.Sqlite" version="8.0.4" targetFramework="net481" />
<package id="Microsoft.Data.Sqlite.Core" version="8.0.4" targetFramework="net481" />
<package id="Microsoft.International.Converters.PinYinConverter" version="1.0.0" targetFramework="net481" />
<package id="Microsoft.IO.RecyclableMemoryStream" version="3.0.0" targetFramework="net481" />
<package id="ModernUI.WPF" version="1.0.9" targetFramework="net481" />
<package id="NStandard" version="0.63.2" targetFramework="net481" />
<package id="pinyin4net" version="1.0.0" targetFramework="net481" />
<package id="SamOatesGames.ModernUI.Xceed.Toolkit" version="1.0.1905191936" targetFramework="net481" />
<package id="SQLitePCLRaw.bundle_e_sqlite3" version="2.1.8" targetFramework="net481" />
<package id="SQLitePCLRaw.core" version="2.1.8" targetFramework="net481" />
<package id="SQLitePCLRaw.lib.e_sqlite3" version="2.1.8" targetFramework="net481" />
<package id="SQLitePCLRaw.provider.dynamic_cdecl" version="2.1.8" targetFramework="net481" />
<package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.118.0" targetFramework="net481" />
<package id="System.Buffers" version="4.5.1" targetFramework="net481" />
<package id="System.ComponentModel.Annotations" version="5.0.0" targetFramework="net481" />
<package id="System.Data.SQLite" version="1.0.118.0" targetFramework="net481" />
<package id="System.Data.SQLite.Core" version="1.0.118.0" targetFramework="net481" />
<package id="System.Data.SQLite.EF6" version="1.0.118.0" targetFramework="net481" />
<package id="System.Data.SQLite.Linq" version="1.0.118.0" targetFramework="net481" />
<package id="System.Memory" version="4.5.5" targetFramework="net481" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net481" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net481" />
<package id="System.Text.Encoding.CodePages" version="8.0.0" targetFramework="net481" />
<package id="Xceed.Products.Wpf.Toolkit.AvalonDock.Themes" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Products.Wpf.Toolkit.Full" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.AvalonDock" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.AvalonDock.Themes.Aero" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.AvalonDock.Themes.FluentDesign" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.AvalonDock.Themes.MaterialDesign" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.AvalonDock.Themes.Metro" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.AvalonDock.Themes.MetroAccent" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.AvalonDock.Themes.Office2007" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.AvalonDock.Themes.VS2010" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.AvalonDock.Themes.Windows10" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.DataGrid.Themes.FluentDesign" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.DataGrid.Themes.MaterialDesign" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.DataGrid.Themes.Metro" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.DataGrid.Themes.Office2007" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.DataGrid.Themes.Windows10" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.DataGrid.Toolkit" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.ListBox" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.ListBox.Themes.FluentDesign" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.ListBox.Themes.LiveExplorer" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.ListBox.Themes.MaterialDesign" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.ListBox.Themes.Metro" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.ListBox.Themes.Office2007" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.ListBox.Themes.Windows10" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.ListBox.Themes.WMP11" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.Themes" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.Themes.FluentDesign" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.Themes.MaterialDesign" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.Themes.MaterialDesignColors" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.Themes.Metro" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.Themes.Office2007" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.Themes.Windows10" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.Toolkit" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.Toolkit.Themes.FluentDesign" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.Toolkit.Themes.MaterialDesign" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.Toolkit.Themes.Metro" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.Toolkit.Themes.Office2007" version="4.6.24151.1544" targetFramework="net481" />
<package id="Xceed.Wpf.Toolkit.Themes.Windows10" version="4.6.24151.1544" targetFramework="net481" />
</packages>