Skip to content

Commit

Permalink
version 1.1.1
Browse files Browse the repository at this point in the history
fixed a small bug in multiple select menu
  • Loading branch information
Peled-Zohar committed May 17, 2021
1 parent 97b572b commit f88fc71
Show file tree
Hide file tree
Showing 38 changed files with 72 additions and 38 deletions.
6 changes: 4 additions & 2 deletions ExtendedConsole/ExConsoleMultipleSelectMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,21 @@ params T[] items
)
{
ValidateArguments();

var menuItems = items.Select(v => new MultipleSelectMenuItem<T>(v, toString)).ToList();

var absoluteTop = Console.CursorTop;
self.WriteLines(displayArgs.Title, "", displayArgs.PleaseSelectText);

var menuTop = Console.CursorTop;

menuItems[0].IsFocused = true;

ShowMenu();
SelectItems();

if (displayArgs.ClearWhenSelected)
{
self.ClearLastLines(Console.CursorTop - menuTop);
self.ClearLastLines(Console.CursorTop - absoluteTop);
}

return menuItems.Where(i => i.IsSelected).Select(i => i.Value);
Expand Down
12 changes: 4 additions & 8 deletions ExtendedConsole/ExtendedConsole.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<LangVersion>7.3</LangVersion>
<PackageReleaseNotes>Changes from previous version:
1. Added a class called MenuDisplayArgs to reduce the number of overloads and simplify the work.
2. Added a new static class called ExConsoleChooseFromEnum, containing methods that once where in ExConsoleMenu class.
3. Added new functionality - multiple select menues, in ExConsoleMultipleSelectMenu class.
This change also comes with a MultipleSelectDisplayArgs class to hold display configuration for the multiple select menu.
4. Changed void methods to return the current instance of the ExConsole class to enable fluent usage.</PackageReleaseNotes>
<Version>1.1.0</Version>
1. Fixed a small bug in multiple select menu</PackageReleaseNotes>
<Version>1.1.1</Version>
<PackageIconUrl>https://raw.githubusercontent.com/Peled-Zohar/ExtendedConsole/master/ExtendedConsole.png</PackageIconUrl>
<ApplicationIcon>extendedconsole.ico</ApplicationIcon>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<FileVersion>1.1.0.0</FileVersion>
<AssemblyVersion>1.1.1.0</AssemblyVersion>
<FileVersion>1.1.1.0</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"targets": {
".NETStandard,Version=v2.0": {},
".NETStandard,Version=v2.0/": {
"ExtendedConsole/1.1.0": {
"ExtendedConsole/1.1.1": {
"dependencies": {
"NETStandard.Library": "2.0.3"
},
Expand All @@ -24,7 +24,7 @@
}
},
"libraries": {
"ExtendedConsole/1.1.0": {
"ExtendedConsole/1.1.1": {
"type": "project",
"serviceable": false,
"sha512": ""
Expand Down
Binary file modified ExtendedConsole/bin/Debug/netstandard2.0/ExtendedConsole.dll
Binary file not shown.
Binary file modified ExtendedConsole/bin/Debug/netstandard2.0/ExtendedConsole.pdb
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"targets": {
".NETStandard,Version=v2.0": {},
".NETStandard,Version=v2.0/": {
"ExtendedConsole/1.1.0": {
"ExtendedConsole/1.1.1": {
"dependencies": {
"NETStandard.Library": "2.0.3"
},
Expand All @@ -24,7 +24,7 @@
}
},
"libraries": {
"ExtendedConsole/1.1.0": {
"ExtendedConsole/1.1.1": {
"type": "project",
"serviceable": false,
"sha512": ""
Expand Down
Binary file modified ExtendedConsole/bin/Release/netstandard2.0/ExtendedConsole.dll
Binary file not shown.
Binary file modified ExtendedConsole/bin/Release/netstandard2.0/ExtendedConsole.pdb
Binary file not shown.
24 changes: 24 additions & 0 deletions ExtendedConsole/obj/Debug/ExtendedConsole.1.1.1.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>ExtendedConsole</id>
<version>1.1.1</version>
<authors>Zohar Peled</authors>
<owners>Zohar Peled</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl>https://github.com/Peled-Zohar/ExtendedConsole/blob/master/LICENSE</licenseUrl>
<projectUrl>https://peled-zohar.github.io/ExtendedConsole/</projectUrl>
<iconUrl>https://raw.githubusercontent.com/Peled-Zohar/ExtendedConsole/master/ExtendedConsole.png</iconUrl>
<description>Provides a set of methods to make your life as a programmer easier when writing a Console application.</description>
<releaseNotes>Changes from previous version:
1. Fixed a small bug in multiple select menu</releaseNotes>
<repository url="https://github.com/Peled-Zohar/ExtendedConsole" />
<dependencies>
<group targetFramework=".NETStandard2.0" />
</dependencies>
</metadata>
<files>
<file src="C:\Development\ExtendedConsole\ExtendedConsole\bin\Debug\netstandard2.0\ExtendedConsole.dll" target="lib\netstandard2.0\ExtendedConsole.dll" />
<file src="C:\Development\ExtendedConsole\ExtendedConsole\bin\Debug\netstandard2.0\ExtendedConsole.xml" target="lib\netstandard2.0\ExtendedConsole.xml" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyDescriptionAttribute("Provides a set of methods to make your life as a programmer easier when writing a" +
" Console application.")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.1.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.1.0")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.1.1.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.1.1")]
[assembly: System.Reflection.AssemblyProductAttribute("ExtendedConsole")]
[assembly: System.Reflection.AssemblyTitleAttribute("ExtendedConsole")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.1.0.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.1.1.0")]
[assembly: System.Resources.NeutralResourcesLanguageAttribute("en")]

// Generated by the MSBuild WriteCodeFragment class.
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3117071fe27058d273a9afca6345afe471e458d0
4349561554698d22fa31286b2368ed1c91d47e96
Binary file modified ExtendedConsole/obj/Debug/netstandard2.0/ExtendedConsole.dll
Binary file not shown.
Binary file modified ExtendedConsole/obj/Debug/netstandard2.0/ExtendedConsole.pdb
Binary file not shown.
2 changes: 1 addition & 1 deletion ExtendedConsole/obj/ExtendedConsole.csproj.nuget.cache
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 1,
"dgSpecHash": "eulTI3NxcRthT6ZYCczhKpZtx40s+WbaU/0e2ObWuMVVr0vCY94KV3EjArtkzomIvO1U1/X4mpFvKkqz2xaUWg==",
"dgSpecHash": "N/lMtwEriST3T1rqfbi3vBhzcz6LoaXgtUsmOG3F7rbvO1BOoKZ/4FB/E1reZhm/ok8zdn36UT4LgrKFUEg+Vg==",
"success": true
}
24 changes: 24 additions & 0 deletions ExtendedConsole/obj/Release/ExtendedConsole.1.1.1.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>ExtendedConsole</id>
<version>1.1.1</version>
<authors>Zohar Peled</authors>
<owners>Zohar Peled</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl>https://github.com/Peled-Zohar/ExtendedConsole/blob/master/LICENSE</licenseUrl>
<projectUrl>https://peled-zohar.github.io/ExtendedConsole/</projectUrl>
<iconUrl>https://raw.githubusercontent.com/Peled-Zohar/ExtendedConsole/master/ExtendedConsole.png</iconUrl>
<description>Provides a set of methods to make your life as a programmer easier when writing a Console application.</description>
<releaseNotes>Changes from previous version:
1. Fixed a small bug in multiple select menu</releaseNotes>
<repository url="https://github.com/Peled-Zohar/ExtendedConsole" />
<dependencies>
<group targetFramework=".NETStandard2.0" />
</dependencies>
</metadata>
<files>
<file src="C:\Development\ExtendedConsole\ExtendedConsole\bin\Release\netstandard2.0\ExtendedConsole.dll" target="lib\netstandard2.0\ExtendedConsole.dll" />
<file src="C:\Development\ExtendedConsole\ExtendedConsole\bin\Release\netstandard2.0\ExtendedConsole.xml" target="lib\netstandard2.0\ExtendedConsole.xml" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyDescriptionAttribute("Provides a set of methods to make your life as a programmer easier when writing a" +
" Console application.")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.1.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.1.0")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.1.1.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.1.1")]
[assembly: System.Reflection.AssemblyProductAttribute("ExtendedConsole")]
[assembly: System.Reflection.AssemblyTitleAttribute("ExtendedConsole")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.1.0.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.1.1.0")]
[assembly: System.Resources.NeutralResourcesLanguageAttribute("en")]

// Generated by the MSBuild WriteCodeFragment class.
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a3ffde1c2a832d8a1682964c38782fff5eea5de9
822ad2fb0315b9c1501c5ac09a5cef82125fb1c2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ C:\Development\ExtendedConsole\ExtendedConsole\bin\Release\netstandard2.0\Extend
C:\Development\ExtendedConsole\ExtendedConsole\bin\Release\netstandard2.0\ExtendedConsole.dll
C:\Development\ExtendedConsole\ExtendedConsole\bin\Release\netstandard2.0\ExtendedConsole.pdb
C:\Development\ExtendedConsole\ExtendedConsole\bin\Release\netstandard2.0\ExtendedConsole.xml
C:\Development\ExtendedConsole\ExtendedConsole\obj\Release\netstandard2.0\ExtendedConsole.csprojAssemblyReference.cache
C:\Development\ExtendedConsole\ExtendedConsole\obj\Release\netstandard2.0\ExtendedConsole.csproj.CoreCompileInputs.cache
C:\Development\ExtendedConsole\ExtendedConsole\obj\Release\netstandard2.0\ExtendedConsole.AssemblyInfoInputs.cache
C:\Development\ExtendedConsole\ExtendedConsole\obj\Release\netstandard2.0\ExtendedConsole.AssemblyInfo.cs
Expand Down
Binary file modified ExtendedConsole/obj/Release/netstandard2.0/ExtendedConsole.dll
Binary file not shown.
Binary file modified ExtendedConsole/obj/Release/netstandard2.0/ExtendedConsole.pdb
Binary file not shown.
2 changes: 1 addition & 1 deletion ExtendedConsole/obj/project.assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {}
},
"project": {
"version": "1.1.0",
"version": "1.1.1",
"restore": {
"projectUniqueName": "C:\\Development\\ExtendedConsole\\ExtendedConsole\\ExtendedConsole.csproj",
"projectName": "ExtendedConsole",
Expand Down
15 changes: 2 additions & 13 deletions UsingExtendedConsole/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@ static void Main(string[] args)
{
Console.Title = "Using Extended Console";

exConsole.ChooseFromEnum<ConsoleColor>("s", true);

var boolean = exConsole.ReadBool(ConsoleKey.Y, ConsoleKey.N, "Please press y or n");
if(boolean)
{
Console.WriteLine("You've entered y");
exConsole.Pause();
}
else
{
exConsole.WriteLine("You've entered n").Pause();
}

var arr = new MID[]
{
new MID(1, "Zohar"),
Expand All @@ -36,6 +23,8 @@ static void Main(string[] args)

var a = exConsole.MultipleSelectMenu(new MultipleSelectDisplayArgs("Multiple select with args", focusedItemColor:ConsoleColor.Cyan), arr);

exConsole.Pause();

var b = exConsole.MultipleSelectMenu(new MultipleSelectDisplayArgs("Multiple select with args and toString"), s => $"<c f='green'>{s.Id}</c> {s.Name}" , arr);

var menus = new Func<int>[] { StringsMenu, ActionsMenu };
Expand Down
Binary file modified UsingExtendedConsole/bin/Debug/ExtendedConsole.dll
Binary file not shown.
Binary file modified UsingExtendedConsole/bin/Debug/ExtendedConsole.pdb
Binary file not shown.
Binary file modified UsingExtendedConsole/bin/Debug/UsingExtendedConsole.exe
Binary file not shown.
Binary file modified UsingExtendedConsole/bin/Debug/UsingExtendedConsole.pdb
Binary file not shown.
Binary file modified UsingExtendedConsole/bin/Release/ExtendedConsole.dll
Binary file not shown.
Binary file modified UsingExtendedConsole/bin/Release/ExtendedConsole.pdb
Binary file not shown.
Binary file modified UsingExtendedConsole/bin/Release/UsingExtendedConsole.exe
Binary file not shown.
Binary file modified UsingExtendedConsole/bin/Release/UsingExtendedConsole.pdb
Binary file not shown.
Binary file not shown.
Binary file modified UsingExtendedConsole/obj/Debug/UsingExtendedConsole.exe
Binary file not shown.
Binary file modified UsingExtendedConsole/obj/Debug/UsingExtendedConsole.pdb
Binary file not shown.
Binary file not shown.
Binary file modified UsingExtendedConsole/obj/Release/UsingExtendedConsole.exe
Binary file not shown.
Binary file modified UsingExtendedConsole/obj/Release/UsingExtendedConsole.pdb
Binary file not shown.

0 comments on commit f88fc71

Please sign in to comment.