開台時隱藏關台畫面
This commit is contained in:
parent
99ae486567
commit
e77b4f4fec
15
TCPServer.cs
15
TCPServer.cs
@ -86,27 +86,29 @@ namespace DualScreenDemo
|
||||
//heartbeatSender sender = new heartbeatSender("127.0.0.1", 8888);
|
||||
//sender.Start();
|
||||
// Console.WriteLine($"heart beat for server{sender.RemoteEndPoint.Address}:{sender.RemoteEndPoint.Port}");
|
||||
|
||||
try {
|
||||
|
||||
string stateFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"txt","states.txt");
|
||||
string stateFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "txt", "states.txt");
|
||||
string initialState = ReadStateFile(stateFilePath);
|
||||
|
||||
/*
|
||||
if (initialState.Equals("CLOSE", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_ = SafeInvoke(PrimaryForm.Instance, () =>
|
||||
{
|
||||
try {
|
||||
/*foreach (Control ctrl in PrimaryForm.Instance.Controls)
|
||||
foreach (Control ctrl in PrimaryForm.Instance.Controls)
|
||||
{
|
||||
ctrl.Enabled = false;
|
||||
}*/
|
||||
}
|
||||
PrimaryForm.Instance.ShowSendOffScreen();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Console.WriteLine($"顯示送客畫面時發生錯誤: {ex.Message}");
|
||||
}
|
||||
});
|
||||
}
|
||||
} */
|
||||
|
||||
|
||||
|
||||
while (true)
|
||||
@ -152,6 +154,7 @@ namespace DualScreenDemo
|
||||
PrimaryForm.Instance.ShowSendOffScreen();
|
||||
Console.WriteLine("開始設置新的播放列表");
|
||||
|
||||
|
||||
string closePath = @"D:\video\CLOSE.MPG";
|
||||
if (File.Exists(closePath))
|
||||
{
|
||||
@ -215,6 +218,8 @@ namespace DualScreenDemo
|
||||
PrimaryForm.currentSongIndexInHistory = -1;
|
||||
PrimaryForm.Instance.HotPlayButton_Click(null, EventArgs.Empty);
|
||||
UpdateStateFile(stateFilePath, "OPEN");
|
||||
PrimaryForm.Instance.HideSendOffScreen();
|
||||
|
||||
|
||||
byte[] okResponse = Encoding.UTF8.GetBytes("OK\n");
|
||||
stream.Write(okResponse, 0, okResponse.Length);
|
||||
|
Loading…
x
Reference in New Issue
Block a user