I have an application written in C#. This app uses a GUI for message display and user input, and the GUI is connected to the app via an interface class:
public interface IEndUserInterface
{
void Reset();
void ShowMsg(Tuple<string, string[]> msg);
void ShowBoolDialog(Tuple<string, string[]> msg);
[...]
event DiagAnswerEventHandler DiagAnswerEvent;
event EventHandler GUIReady;
event EventHandler StartProcess;
[...]
}
The methods are used to display stuff on the GUI, the events signal actions or inputs to the app.
When ShowBoolDialog()
is called there is a timeout started that sends the Reset()
after a while with no user input.
When there is a Message to be displayed there is another timer that cleares the screen (or shows the following message) after it finished.
So there are two questions:
First, I think the timing of the messages should all be done outside the GUI. What do you think: should it be in the app or in the GUI?
And what kind of pattern does this approach of connecting the GUI to the app follow? I can't see the MVC-pattern in it, but felt inspired by it...