Skip to content

Commit

Permalink
🚧 (format) format most documents
Browse files Browse the repository at this point in the history
  • Loading branch information
MorganKryze committed Dec 30, 2023
1 parent 9b5e2f4 commit 6875791
Show file tree
Hide file tree
Showing 13 changed files with 942 additions and 412 deletions.
154 changes: 117 additions & 37 deletions example/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,21 @@ private static void Main()

Menu:

var index = Core.ScrollingMenuSelector("What will be your next action?", 0, Placement.Center, null,
"Change Console color",
"Write on the console",
"Display paragraph",
"Display a styled text",
"Display a matrix",
"Answer some prompt",
"Select a number",
"Display table",
"Quit the app");
var index = Core.ScrollingMenuSelector(
"What will be your next action?",
0,
Placement.Center,
null,
"Change Console color",
"Write on the console",
"Display paragraph",
"Display a styled text",
"Display a matrix",
"Answer some prompt",
"Select a number",
"Display table",
"Quit the app"
);
Core.ClearContent();
switch (index.Item1)
{
Expand All @@ -40,8 +45,21 @@ private static void Main()
{
case 0:
Core.UpdateScreen();
var indexColor = Core.ScrollingMenuSelector("What color do you want to change?", 0, Placement.Center, default, "White", "Red", "Green", "Blue", "Yellow", "Magenta", "Cyan");
switch(indexColor.Item2){
var indexColor = Core.ScrollingMenuSelector(
"What color do you want to change?",
0,
Placement.Center,
default,
"White",
"Red",
"Green",
"Blue",
"Yellow",
"Magenta",
"Cyan"
);
switch (indexColor.Item2)
{
case 0:
Core.ChangeForeground(ConsoleColor.White);
break;
Expand Down Expand Up @@ -70,11 +88,44 @@ private static void Main()
break;
case 1:
Core.UpdateScreen();
Core.WriteContinuousString("Have a look on the console to see all the text!", Core.ContentHeight, true, 1500, 1000, default, default, true);
Core.WritePositionedString("Bonjour le monde !", Placement.Left, false, Core.ContentHeight + 1, true);
Core.WritePositionedString("Hola Mundo !", Placement.Right, false, Core.ContentHeight + 2, true);
Core.WritePositionedString("Hallo Welt !", Placement.Center, false, Core.ContentHeight + 3, true);
Core.WritePositionedString("Ciao mondo !", Placement.Left, false, Core.ContentHeight + 4, true);
Core.WriteContinuousString(
"Have a look on the console to see all the text!",
Core.ContentHeight,
true,
1500,
1000,
default,
default,
true
);
Core.WritePositionedString(
"Bonjour le monde !",
Placement.Left,
false,
Core.ContentHeight + 1,
true
);
Core.WritePositionedString(
"Hola Mundo !",
Placement.Right,
false,
Core.ContentHeight + 2,
true
);
Core.WritePositionedString(
"Hallo Welt !",
Placement.Center,
false,
Core.ContentHeight + 3,
true
);
Core.WritePositionedString(
"Ciao mondo !",
Placement.Left,
false,
Core.ContentHeight + 4,
true
);

Console.ReadKey();
Core.ClearContent();
Expand All @@ -83,7 +134,16 @@ private static void Main()
case 2:
Core.UpdateScreen();

Core.WriteMultiplePositionedLines(default, default, default, "C# is a general-purpose, multi-paradigm programming language encompassing strong typing,","lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based),"," and component-oriented programming disciplines.", "", "Press [Enter] to continue...");
Core.WriteMultiplePositionedLines(
default,
default,
default,
"C# is a general-purpose, multi-paradigm programming language encompassing strong typing,",
"lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based),",
" and component-oriented programming disciplines.",
"",
"Press [Enter] to continue..."
);

Console.ReadKey();
Core.ClearContent();
Expand All @@ -110,7 +170,8 @@ private static void Main()
List<int?> secondRow = new() { 4, 5, 6, 8, null, 2 };
List<int?> thirdRow = new() { 7, 8, null, 3, 4, 5 };
List<int?> fourthRow = new() { null, 2, 3, 4, 5, 6 };
List<List<int?>> data = new() { firstRow, secondRow, thirdRow, fourthRow };
List<List<int?>> data =
new() { firstRow, secondRow, thirdRow, fourthRow };
Matrix<int?> matrix = new(data);
matrix.SetRoundedCorners(false);
matrix.WriteMatrix(Placement.Center);
Expand Down Expand Up @@ -144,24 +205,32 @@ private static void Main()
case 6:
Core.UpdateScreen();

var answerNumber = Core.ScrollingNumberSelector("Select a number", 10, 50, 25, 5);
var answerNumber = Core.ScrollingNumberSelector(
"Select a number",
10,
50,
25,
5
);
float number = answerNumber.Item2;

Core.ClearContent();
break;
case 7:
Core.UpdateScreen();

List<string> headers = new () {"id", "name", "major", "grades"};
List<string> student1 = new () {"01", "Theo", "Technology", "97"};
List<string> student2 = new () {"02", "Paul", "Mathematics", "86"};
List<string> student3 = new () {"03", "Maxime", "Physics", "92"};
List<string> student4 = new () {"04", "Charles", "Computer Science", "100"};
Table<string> students = new (headers, new () {student1, student2, student3, student4});
List<string> headers = new() { "id", "name", "major", "grades" };
List<string> student1 = new() { "01", "Theo", "Technology", "97" };
List<string> student2 = new() { "02", "Paul", "Mathematics", "86" };
List<string> student3 = new() { "03", "Maxime", "Physics", "92" };
List<string> student4 =
new() { "04", "Charles", "Computer Science", "100" };
Table<string> students =
new(headers, new() { student1, student2, student3, student4 });
students.SetRoundedCorners(false);
students.ScrollingTableSelector(true, false, "Add student");

students.UpdateLine(0, new () {"01", "Theo", "Biology", "100"});
students.UpdateLine(0, new() { "01", "Theo", "Biology", "100" });
students.RemoveLine(3);
students.ScrollingTableSelector(true, true);

Expand All @@ -171,28 +240,38 @@ private static void Main()
default:
Core.ClearContent();
Core.UpdateScreen();

Core.ExitProgram();
break;
}
}
break;

case Output.Exit:
case Output.Exit:
Core.ClearContent();
Core.UpdateScreen();

Core.WriteMultiplePositionedLines(default, true, default, "You have selected to quit the app. Press [Enter] to continue...");

Core.WriteMultiplePositionedLines(
default,
true,
default,
"You have selected to quit the app. Press [Enter] to continue..."
);

Console.ReadKey();
Core.ExitProgram();
break;

case Output.Delete:
case Output.Delete:
Core.ClearContent();
Core.UpdateScreen();

Core.WriteMultiplePositionedLines(default, true, default, "You have selected the backspace tile. Press [Enter] to continue...");

Core.WriteMultiplePositionedLines(
default,
true,
default,
"You have selected the backspace tile. Press [Enter] to continue..."
);

Console.ReadKey();
break;

Expand All @@ -201,9 +280,10 @@ private static void Main()
}
goto Menu;
}

public static void Debugging()
{
{
// Debug code placeholder
}
}
}
}
9 changes: 5 additions & 4 deletions src/ConsoleAppVisuals/ConsoleAppVisuals.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup>
<PropertyGroup>
<Title>ConsoleAppVisuals</Title>
<PackageId>ConsoleAppVisuals</PackageId>
<Authors>MorganK</Authors>
<Version>0.0.0</Version>
<Description>User-friendly .NET visuals library designed for console apps</Description>
<Summary>ConsoleAppVisuals is a library mainly made to get fast results in the console using menus, displays, animations. Highly customizable, feel free to make it yours!</Summary>
<Summary>ConsoleAppVisuals is a library mainly made to get fast results in the console using
menus, displays, animations. Highly customizable, feel free to make it yours!</Summary>
<PackageLicenceExpression>MIT</PackageLicenceExpression>
<NeutralLanguage>en-US</NeutralLanguage>
<PackageTags>Visuals, ConsoleApp</PackageTags>
Expand All @@ -37,8 +38,8 @@
<EmbeddedResource Include="fonts\ANSI_Shadow\data\numbers.txt" />
<EmbeddedResource Include="fonts\ANSI_Shadow\data\symbols.txt" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="yamldotnet" Version="13.7.1" />
</ItemGroup>
</Project>
</Project>
Loading

0 comments on commit 6875791

Please sign in to comment.