-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from CUMGroup/account-timeout
Account timeout
- Loading branch information
Showing
28 changed files
with
356 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace PWManager.Application.Context; | ||
|
||
public interface ICancelEnvironment { | ||
bool CancelableState { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using Sharprompt; | ||
|
||
namespace PWManager.CLI.Abstractions; | ||
|
||
public static class ConsoleInteraction { | ||
|
||
public static event Action OnConsoleInput; | ||
|
||
public static T Input<T>(string prompt) { | ||
OnConsoleInput(); | ||
var res = Prompt.Input<T>(prompt); | ||
OnConsoleInput(); | ||
return res; | ||
} | ||
|
||
public static bool Confirm(string prompt) { | ||
OnConsoleInput(); | ||
var res = Prompt.Confirm(prompt); | ||
OnConsoleInput(); | ||
return res; | ||
} | ||
|
||
public static T Select<T>(string message, IEnumerable<T>? items = null, object? defaultValue = null) where T : notnull { | ||
OnConsoleInput(); | ||
var res = Prompt.Select<T>(message, items, defaultValue: defaultValue); | ||
OnConsoleInput(); | ||
return res; | ||
} | ||
|
||
public static IEnumerable<T> MultiSelect<T>(string message, IEnumerable<T>? items = null, IEnumerable<T>? defaultValues = null) | ||
where T : notnull { | ||
OnConsoleInput(); | ||
var res = Prompt.MultiSelect<T>(message, items, defaultValues: defaultValues); | ||
OnConsoleInput(); | ||
return res; | ||
} | ||
|
||
public static string Password(string message) { | ||
OnConsoleInput(); | ||
var res = Prompt.Password(message); | ||
OnConsoleInput(); | ||
return res; | ||
} | ||
|
||
public static string? ReadLine() { | ||
OnConsoleInput(); | ||
var res = Console.ReadLine(); | ||
OnConsoleInput(); | ||
return res; | ||
} | ||
|
||
public static void ResetConsole() { | ||
Console.CursorVisible = true; | ||
Console.ResetColor(); | ||
Console.SetCursorPosition(0, Console.CursorTop); | ||
Console.WriteLine(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.