Skip to content

Commit 683b977

Browse files
committed
Rollback of changes on ExitCommand, toolbar does not work well on Windows 10, should not be uses by default.
1 parent 26d6c52 commit 683b977

File tree

15 files changed

+20
-16
lines changed

15 files changed

+20
-16
lines changed

Templates/PowerCommands.zip

295 Bytes
Binary file not shown.

Templates/src/Core/PainKiller.PowerCommands.Configuration/DOMAINOBJECTS/ToolbarConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ namespace $safeprojectname$.DomainObjects;
44

55
public class ToolbarConfiguration
66
{
7-
public HideToollbarOption HideToollbarOption { get; set; } = HideToollbarOption.Never;
7+
public HideToolbarOption HideToolbarOption { get; set; } = HideToolbarOption.Never;
88
public List<ToolbarItemConfiguration> ToolbarItems { get; set; } = new();
99
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace $safeprojectname$.Enums;
2+
3+
public enum HideToolbarOption
4+
{
5+
Never,
6+
OnTextChange,
7+
OnCommandHighlighted
8+
}

Templates/src/Core/PainKiller.PowerCommands.Configuration/MyTemplate.vstemplate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<ProjectItem ReplaceParameters="true" TargetFileName="YamlContainer.cs">YamlContainer.cs</ProjectItem>
3232
</Folder>
3333
<Folder Name="Enums" TargetFolderName="Enums">
34-
<ProjectItem ReplaceParameters="true" TargetFileName="HideToollbarOption.cs">HideToollbarOption.cs</ProjectItem>
34+
<ProjectItem ReplaceParameters="true" TargetFileName="HideToolbarOption.cs">HideToolbarOption.cs</ProjectItem>
3535
</Folder>
3636
<Folder Name="Extensions" TargetFolderName="Extensions">
3737
<ProjectItem ReplaceParameters="true" TargetFileName="ConfigurationExtension.cs">ConfigurationExtension.cs</ProjectItem>

Templates/src/Core/PainKiller.PowerCommands.Configuration/PainKiller.PowerCommands.Configuration.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
<ItemGroup>
1616
<Folder Include="Extensions\" />
17-
<Folder Include="Enums\" />
1817
</ItemGroup>
1918

2019
</Project>

Templates/src/Core/PainKiller.PowerCommands.Core/COMMANDS/ExitCommand.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
namespace $safeprojectname$.Commands;
22

3-
[PowerCommandsToolbar("[Exit? ->]|y(es)")]
43
[PowerCommandDesign( description: "Exit command exits the program",
54
arguments: "<answer>(any answer starting with y will close the application)",
65
suggestions: "y",
76
disableProxyOutput: true,
87
example: "exit|exit y|exit Yes")]
9-
public class ExitCommand : CommandWithToolbarBase<CommandsConfiguration>
8+
public class ExitCommand : CommandBase<CommandsConfiguration>
109
{
1110
public ExitCommand(string identifier, CommandsConfiguration configuration) : base(identifier, configuration) { }
1211
public override RunResult Run()

Templates/src/Core/PainKiller.PowerCommands.Core/SERVICES/DialogService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ public static void DrawToolbar(ToolbarConfiguration? configuration)
5858
_configuration = configuration;
5959
if(_configuration == null ) return;
6060
DrawToolbar(_configuration.ToolbarItems.Select(t => t.Label).ToArray(),_configuration.ToolbarItems.Select(t => t.Color).ToArray());
61-
if(_configuration.HideToollbarOption == HideToollbarOption.OnTextChange) ReadLineService.CmdLineTextChanged += ReadLineService_CmdLineTextChanged;
62-
else if(_configuration.HideToollbarOption == HideToollbarOption.OnCommandHighlighted) ReadLineService.CommandHighlighted += ReadLineService_CommandHighlighted;
61+
if(_configuration.HideToolbarOption == HideToolbarOption.OnTextChange) ReadLineService.CmdLineTextChanged += ReadLineService_CmdLineTextChanged;
62+
else if(_configuration.HideToolbarOption == HideToolbarOption.OnCommandHighlighted) ReadLineService.CommandHighlighted += ReadLineService_CommandHighlighted;
6363
}
6464

6565
private static void ReadLineService_CommandHighlighted(object? sender, ReadLine.Events.CommandHighlightedArgs e)

Templates/src/PainKiller.PowerCommands.MyExampleCommands/PowerCommandsConfiguration.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ configuration:
77
backupPath: ..\..\..\..\Core\PainKiller.PowerCommands.Core\
88
defaultGitRepositoryPath: ..\..\..\..\..\
99
startupToolbar:
10-
hideToollbarOption: OnCommandHighlighted
10+
hideToolbarOption: OnCommandHighlighted
1111
toolbarItems:
1212
- label: "[Type ->]"
1313
color: "Cyan"

src/PainKiller.PowerCommands.zip

-7.19 MB
Binary file not shown.

src/PainKiller.PowerCommands/Core/PainKiller.PowerCommands.Configuration/DomainObjects/ToolbarConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ namespace PainKiller.PowerCommands.Configuration.DomainObjects;
44

55
public class ToolbarConfiguration
66
{
7-
public HideToollbarOption HideToollbarOption { get; set; } = HideToollbarOption.Never;
7+
public HideToolbarOption HideToolbarOption { get; set; } = HideToolbarOption.Never;
88
public List<ToolbarItemConfiguration> ToolbarItems { get; set; } = new();
99
}

0 commit comments

Comments
 (0)