Initial commit

This commit is contained in:
Mark J Price 2022-02-13 16:03:32 +00:00
parent d5bde3c775
commit 5fb8e6929b
33 changed files with 842 additions and 0 deletions

View file

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Using Include="System.Console" Static="true" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,32 @@
WriteLine($"There are {args.Length} arguments.");
foreach (string arg in args)
{
WriteLine(arg);
}
if (args.Length < 3)
{
WriteLine("You must specify two colors and cursor size, e.g.");
WriteLine("dotnet run red yellow 50");
return; // stop running
}
ForegroundColor = (ConsoleColor)Enum.Parse(
enumType: typeof(ConsoleColor),
value: args[0],
ignoreCase: true);
BackgroundColor = (ConsoleColor)Enum.Parse(
enumType: typeof(ConsoleColor),
value: args[1],
ignoreCase: true);
try
{
CursorSize = int.Parse(args[2]);
}
catch (PlatformNotSupportedException)
{
WriteLine("The current platform does not support changing the size of the cursor.");
}

View file

@ -0,0 +1,8 @@
{
"profiles": {
"Arguments": {
"commandName": "Project",
"commandLineArgs": "red yellow 50"
}
}
}