2015-01-03 07:20:34 +00:00
|
|
|
|
using System.Collections.Generic;
|
2014-03-23 08:17:41 +00:00
|
|
|
|
|
2020-04-21 09:12:17 +00:00
|
|
|
|
namespace Flow.Launcher.Plugin.Shell
|
2014-03-23 08:17:41 +00:00
|
|
|
|
{
|
2016-05-19 08:04:31 +00:00
|
|
|
|
public class Settings
|
2014-03-23 08:17:41 +00:00
|
|
|
|
{
|
2016-06-23 21:53:30 +00:00
|
|
|
|
public Shell Shell { get; set; } = Shell.Cmd;
|
2021-04-12 09:06:44 +00:00
|
|
|
|
|
2022-03-19 09:04:10 +00:00
|
|
|
|
public bool ReplaceWinR { get; set; } = false;
|
2021-04-12 09:06:44 +00:00
|
|
|
|
|
2016-05-19 08:04:31 +00:00
|
|
|
|
public bool LeaveShellOpen { get; set; }
|
2021-04-12 09:06:44 +00:00
|
|
|
|
|
2019-12-10 09:24:18 +00:00
|
|
|
|
public bool RunAsAdministrator { get; set; } = true;
|
2019-12-09 21:23:34 +00:00
|
|
|
|
|
2021-04-12 09:06:44 +00:00
|
|
|
|
public bool ShowOnlyMostUsedCMDs { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int ShowOnlyMostUsedCMDsNumber { get; set; }
|
|
|
|
|
|
|
2021-04-12 07:32:48 +00:00
|
|
|
|
public Dictionary<string, int> CommandHistory { get; set; } = new Dictionary<string, int>();
|
2015-01-05 14:41:17 +00:00
|
|
|
|
|
2014-03-23 08:17:41 +00:00
|
|
|
|
public void AddCmdHistory(string cmdName)
|
|
|
|
|
|
{
|
2021-04-12 07:32:48 +00:00
|
|
|
|
if (CommandHistory.ContainsKey(cmdName))
|
2014-03-23 08:17:41 +00:00
|
|
|
|
{
|
2021-04-12 07:32:48 +00:00
|
|
|
|
CommandHistory[cmdName] += 1;
|
2014-03-23 08:17:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2021-04-12 07:32:48 +00:00
|
|
|
|
CommandHistory.Add(cmdName, 1);
|
2014-03-23 08:17:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2016-05-19 08:04:31 +00:00
|
|
|
|
|
|
|
|
|
|
public enum Shell
|
|
|
|
|
|
{
|
2016-06-23 21:53:30 +00:00
|
|
|
|
Cmd = 0,
|
2016-05-19 08:04:31 +00:00
|
|
|
|
Powershell = 1,
|
|
|
|
|
|
RunCommand = 2,
|
2023-06-12 13:18:23 +00:00
|
|
|
|
Pwsh = 3,
|
2016-05-19 08:04:31 +00:00
|
|
|
|
}
|
2014-03-23 08:17:41 +00:00
|
|
|
|
}
|