20250420
This commit is contained in:
49
demo2/Program.cs
Normal file
49
demo2/Program.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using anbs_cp.Classes;
|
||||
using anbs_cp.Enums;
|
||||
using anbs_cp.Extensions;
|
||||
|
||||
// KeyValueOrderedTest
|
||||
void DoTest1 ()
|
||||
{
|
||||
Console.WriteLine("Вы выбрали тест KeyValueOrdered. В список будут по очереди добавляться данные.");
|
||||
KeyValueOrderedList<string> kv = [];
|
||||
Console.WriteLine("Добавляю данные: я=>Вася");
|
||||
kv.Add(new("я", "Вася"));
|
||||
Console.WriteLine(kv.Serialize());
|
||||
Console.WriteLine("Добавляю данные: он=>Петя");
|
||||
kv.Add(new("он", "Петя"));
|
||||
Console.WriteLine(kv.Serialize());
|
||||
Console.WriteLine("Добавляю данные: я=>Саша");
|
||||
kv.Add(new("я", "Саша"));
|
||||
Console.WriteLine(kv.Serialize());
|
||||
Console.ReadLine();
|
||||
}
|
||||
|
||||
// StringExtensions 1
|
||||
void DoTest2 ()
|
||||
{
|
||||
Console.WriteLine("Вы выбрали тест StringExtensions 1. Введите предложение:");
|
||||
string str = Console.ReadLine() ?? string.Empty;
|
||||
Console.WriteLine($"None: {str.Transform(ETextTransform.None)}");
|
||||
Console.WriteLine($"LowerCase: {str.Transform(ETextTransform.LowerCase)}");
|
||||
Console.WriteLine($"UpperCase: {str.Transform(ETextTransform.UpperCase)}");
|
||||
Console.WriteLine($"FirstUpper: {str.Transform(ETextTransform.FirstUpper)}");
|
||||
Console.ReadLine();
|
||||
}
|
||||
|
||||
Console.WriteLine("Выберете тест:");
|
||||
|
||||
if (!int.TryParse(Console.ReadLine(), out int testNum))
|
||||
testNum = 0;
|
||||
|
||||
switch (testNum)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
DoTest1();
|
||||
break;
|
||||
case 2:
|
||||
DoTest2();
|
||||
break;
|
||||
}
|
16
demo2/demo2.csproj
Normal file
16
demo2/demo2.csproj
Normal file
@@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<PublishAot>true</PublishAot>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\anbs_cp\anbs_cp.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
Reference in New Issue
Block a user