Reorganize and Add UserManager
This commit is contained in:
53
Views/FingerprintDialog.cs
Normal file
53
Views/FingerprintDialog.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using NStack;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Terminal.Gui;
|
||||
|
||||
namespace Akari.Provider.WaveshareUART.Views
|
||||
{
|
||||
public class FingerprintDialog : Dialog
|
||||
{
|
||||
public string ErrorTitle { get; set; }
|
||||
public string ErrorMessage { get; set; }
|
||||
|
||||
public FingerprintDialog(string errorTitle, string errorMessage) : base(errorTitle, 60, 7)
|
||||
{
|
||||
ErrorTitle = errorTitle;
|
||||
ErrorMessage = errorMessage;
|
||||
|
||||
ColorScheme = Colors.ColorSchemes["Menu"];
|
||||
}
|
||||
|
||||
public void Show()
|
||||
{
|
||||
var label = new Label("Please place your finger flat on the sensor")
|
||||
{
|
||||
X = Pos.Center(),
|
||||
Y = Pos.Center(),
|
||||
Height = 1
|
||||
};
|
||||
|
||||
Add(label);
|
||||
|
||||
Application.Run(this);
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
Application.MainLoop.Invoke(() => Application.RequestStop());
|
||||
}
|
||||
|
||||
public void CancelAndShowError()
|
||||
{
|
||||
Application.MainLoop.Invoke(() =>
|
||||
{
|
||||
MessageBox.ErrorQuery(ErrorTitle, ErrorMessage, "Ok");
|
||||
|
||||
Application.RequestStop();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user