GabrielTofvesson bdbb1342ba Massive update
* Added new endpoint for updating password
* Added internationalization method to ContextManager and Context
* Updated contexts to use internationalization
* Added a fancy text-based UI to the server
* Added translations
* Moved Promise class to its own file
* Made BankNetInteractor its own file
* Added a lot of convenient methods
* Added many more comments
* Fixed input event management in ButtonView
* Added support for dynamic ListView content modification
* Added more layouts
* Fixed some namespaces
* Added more commands to the server
2018-05-13 20:04:01 +02:00

29 lines
791 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Client.ConsoleForms.Parameters;
using Client.ConsoleForms.Events;
namespace Client.ConsoleForms.Graphics
{
public class ButtonView : TextView, ISubmissionListener
{
protected SubmissionEvent evt;
public ButtonView(ViewData parameters, LangManager lang) : base(parameters, lang)
{
}
public override bool HandleKeyEvent(ConsoleController.KeyEvent info, bool inFocus)
{
bool b = inFocus && info.ValidEvent && info.Event.Key == ConsoleKey.Enter;
if (b) evt?.Invoke(this);
return b;
}
public void SetEvent(SubmissionEvent listener) => evt = listener;
}
}