Normalize all existing files to LF

This commit is contained in:
Youmu Liu
2026-03-06 18:31:11 +08:00
parent 0a0af53af1
commit 2149bbeede
323 changed files with 113191 additions and 113191 deletions
+105 -105
View File
@@ -1,105 +1,105 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terminal.Gui;
namespace StgSharpTerminalDialogue
{
internal class DialogueView:Window
{
TextView tittle = new TextView()
{
Text = """"
███████╗████████╗ ██████╗ ███████╗██╗ ██╗ █████╗ ██████╗ ██████╗
██╔════╝╚══██╔══╝██╔════╝ ██╔════╝██║ ██║██╔══██╗██╔══██╗██╔══██╗
███████╗ ██║ ██║ ███╗███████╗███████║███████║██████╔╝██████╔╝
╚════██║ ██║ ██║ ██║╚════██║██╔══██║██╔══██║██╔══██╗██╔═══╝
███████║ ██║ ╚██████╔╝███████║██║ ██║██║ ██║██║ ██║██║
╚══════╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝
"""",
//generate from site: https://www.asciiart.eu/text-to-ascii-art
//font: ANSI shadow
TextAlignment = Alignment.Start,
Width = 8 * 9,
Height = 1 * 8,
X = 0,
Y = 0,
ColorScheme = common
};
static readonly Terminal.Gui.Attribute
commonColor = Application.Driver!.MakeColor(
new Color(92, 180, 225), Color.Cyan),
errorColor = Application.Driver!.MakeColor(
Color.White, Color.BrightRed);
static ColorScheme common = new ColorScheme(){
Focus = commonColor,
Normal = commonColor
},
error = new ColorScheme()
{
Focus = errorColor,
Normal = errorColor
};
public static DialogueView Single
{
get => new DialogueView();
}
private DialogueView()
{
Init();
}
private void Init()
{
ColorScheme = common;
this.Width = Dim.Fill(0);
this.Height = Dim.Fill(0);
this.X = 0;
this.Y = 0;
this.Title = "StgSharp Framework Dialogue";
this.Add(this.tittle);
}
public void ShowError(string message)
{
this.Remove(this.tittle);
this.ColorScheme = error;
this.Text =
"""
██╗ ███████╗██████╗ ██████╗ ██████╗ ██████╗
██╗ ██╔╝ ██╔════╝██╔══██╗██╔══██╗██╔═══██╗██╔══██╗
╚═╝ ██║ █████╗ ██████╔╝██████╔╝██║ ██║██████╔╝
██╗ ██║ ██╔══╝ ██╔══██╗██╔══██╗██║ ██║██╔══██╗
╚═╝ ╚██╗ ███████╗██║ ██║██║ ██║╚██████╔╝██║ ██║
╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
""" + "\n"+
message;
Button button = new Button()
{
Text = "Click to quit."
};
button.Accept += (sender,e) => {
Application.RequestStop();
};
this.Add(button);
this.SetNeedsDisplay();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terminal.Gui;
namespace StgSharpTerminalDialogue
{
internal class DialogueView:Window
{
TextView tittle = new TextView()
{
Text = """"
███████╗████████╗ ██████╗ ███████╗██╗ ██╗ █████╗ ██████╗ ██████╗
██╔════╝╚══██╔══╝██╔════╝ ██╔════╝██║ ██║██╔══██╗██╔══██╗██╔══██╗
███████╗ ██║ ██║ ███╗███████╗███████║███████║██████╔╝██████╔╝
╚════██║ ██║ ██║ ██║╚════██║██╔══██║██╔══██║██╔══██╗██╔═══╝
███████║ ██║ ╚██████╔╝███████║██║ ██║██║ ██║██║ ██║██║
╚══════╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝
"""",
//generate from site: https://www.asciiart.eu/text-to-ascii-art
//font: ANSI shadow
TextAlignment = Alignment.Start,
Width = 8 * 9,
Height = 1 * 8,
X = 0,
Y = 0,
ColorScheme = common
};
static readonly Terminal.Gui.Attribute
commonColor = Application.Driver!.MakeColor(
new Color(92, 180, 225), Color.Cyan),
errorColor = Application.Driver!.MakeColor(
Color.White, Color.BrightRed);
static ColorScheme common = new ColorScheme(){
Focus = commonColor,
Normal = commonColor
},
error = new ColorScheme()
{
Focus = errorColor,
Normal = errorColor
};
public static DialogueView Single
{
get => new DialogueView();
}
private DialogueView()
{
Init();
}
private void Init()
{
ColorScheme = common;
this.Width = Dim.Fill(0);
this.Height = Dim.Fill(0);
this.X = 0;
this.Y = 0;
this.Title = "StgSharp Framework Dialogue";
this.Add(this.tittle);
}
public void ShowError(string message)
{
this.Remove(this.tittle);
this.ColorScheme = error;
this.Text =
"""
██╗ ███████╗██████╗ ██████╗ ██████╗ ██████╗
██╗ ██╔╝ ██╔════╝██╔══██╗██╔══██╗██╔═══██╗██╔══██╗
╚═╝ ██║ █████╗ ██████╔╝██████╔╝██║ ██║██████╔╝
██╗ ██║ ██╔══╝ ██╔══██╗██╔══██╗██║ ██║██╔══██╗
╚═╝ ╚██╗ ███████╗██║ ██║██║ ██║╚██████╔╝██║ ██║
╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
""" + "\n"+
message;
Button button = new Button()
{
Text = "Click to quit."
};
button.Accept += (sender,e) => {
Application.RequestStop();
};
this.Add(button);
this.SetNeedsDisplay();
}
}
}
+57 -57
View File
@@ -1,57 +1,57 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="PostOpration"
// Project: StgSharp
// AuthorGroup: Nitload
// Copyright (c) Nitload. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using System.IO;
namespace StgSharpTerminalDialogue
{
internal static partial class Program
{
private static DialogueView _dv;
internal static void PostOperation(
string instruction,
string operand
)
{
switch (instruction)
{
case "posterror":
_dv.ShowError(operand);
using (StreamWriter sw = new StreamWriter(
_callerServerPipe)) {
sw.WriteLine("ERRORGET");
}
break;
default:
break;
}
}
}
}
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="PostOpration"
// Project: StgSharp
// AuthorGroup: Nitload
// Copyright (c) Nitload. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using System.IO;
namespace StgSharpTerminalDialogue
{
internal static partial class Program
{
private static DialogueView _dv;
internal static void PostOperation(
string instruction,
string operand
)
{
switch (instruction)
{
case "posterror":
_dv.ShowError(operand);
using (StreamWriter sw = new StreamWriter(
_callerServerPipe)) {
sw.WriteLine("ERRORGET");
}
break;
default:
break;
}
}
}
}
+112 -112
View File
@@ -1,112 +1,112 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="Program"
// Project: StgSharp
// AuthorGroup: Nitload
// Copyright (c) Nitload. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using System;
using System.Globalization;
using System.IO;
using System.IO.Pipes;
using System.Threading;
using System.Threading.Tasks;
using Terminal.Gui;
namespace StgSharpTerminalDialogue
{
internal static partial class Program
{
private static AnonymousPipeClientStream _callerClientPipe, _callerServerPipe;
private static void Main(
string[] args
)
{
Application.Init();
Console.CancelKeyPress += (
sender,
e
) => {
e.Cancel = true;
Application.RequestStop();
};
Task renderTask = Task.Factory
.StartNew((
) => {
_dv = DialogueView.Single;
Application.Run(view:_dv);
}, CancellationToken.None, TaskCreationOptions.None,
TaskScheduler.Default);
/**/
if (args.Length != 2)
{
Console.ReadLine();
Application.RequestStop();
}
/**/
_callerClientPipe = new AnonymousPipeClientStream(
PipeDirection.In, args[0]);
_callerServerPipe = new AnonymousPipeClientStream(
PipeDirection.Out, args[1]);
using (StreamReader clientReader = new StreamReader(
_callerClientPipe))
{
using (StreamWriter clientSender = new StreamWriter(
_callerServerPipe))
{
clientSender.AutoFlush = true;
string temp = string.Empty;
while (!temp!.Contains("exit ") && !renderTask.IsCompleted)
{
temp = clientReader.ReadLine()!;
temp = temp ?? string.Empty;
if (string.IsNullOrEmpty(temp))
{
continue;
}
int index = temp.IndexOf(' ');
if (index == -1)
{
continue;
}
string command = temp[..index];
string operand = temp[(index + 1)..];
PostOperation(command, operand);
}
}
}
}
}
}
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="Program"
// Project: StgSharp
// AuthorGroup: Nitload
// Copyright (c) Nitload. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using System;
using System.Globalization;
using System.IO;
using System.IO.Pipes;
using System.Threading;
using System.Threading.Tasks;
using Terminal.Gui;
namespace StgSharpTerminalDialogue
{
internal static partial class Program
{
private static AnonymousPipeClientStream _callerClientPipe, _callerServerPipe;
private static void Main(
string[] args
)
{
Application.Init();
Console.CancelKeyPress += (
sender,
e
) => {
e.Cancel = true;
Application.RequestStop();
};
Task renderTask = Task.Factory
.StartNew((
) => {
_dv = DialogueView.Single;
Application.Run(view:_dv);
}, CancellationToken.None, TaskCreationOptions.None,
TaskScheduler.Default);
/**/
if (args.Length != 2)
{
Console.ReadLine();
Application.RequestStop();
}
/**/
_callerClientPipe = new AnonymousPipeClientStream(
PipeDirection.In, args[0]);
_callerServerPipe = new AnonymousPipeClientStream(
PipeDirection.Out, args[1]);
using (StreamReader clientReader = new StreamReader(
_callerClientPipe))
{
using (StreamWriter clientSender = new StreamWriter(
_callerServerPipe))
{
clientSender.AutoFlush = true;
string temp = string.Empty;
while (!temp!.Contains("exit ") && !renderTask.IsCompleted)
{
temp = clientReader.ReadLine()!;
temp = temp ?? string.Empty;
if (string.IsNullOrEmpty(temp))
{
continue;
}
int index = temp.IndexOf(' ');
if (index == -1)
{
continue;
}
string command = temp[..index];
string operand = temp[(index + 1)..];
PostOperation(command, operand);
}
}
}
}
}
}
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="Terminal.Gui" Version="2.0.0-v2-develop.2329" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="Terminal.Gui" Version="2.0.0-v2-develop.2329" />
</ItemGroup>
</Project>