How to make a global event

Asked

Viewed 71 times

2

I develop a system in which, a user can send a message to another, (which is saved in the database, to have a conversation history), but I would like that while the user is using other functions of the system, an event occurred and opened a window informing that it received a message.

I intend to create a static class that will keep checking if there are new messages. But how could I activate this event, and treat it?

EDIT

As it will have many users logged into the system at the same time, there would be no way for a Rigger from the bank itself to send a signal to the system? Yeah, I’m afraid it’ll hurt the bank’s speed if I keep opening and closing on this timer.

1 answer

1

You could add a Timer in the form that will display the messages and in the Tick event ask to check in the bank if there is new message. You could have in the table a Columa to inform if the message was read or not, I indicate a Boolean : 0 and 1 in the field and if true, it changes the form text or something like.

  • 2

    I think it would be nice Timer invoke a Thread that performs this verification, without blocking the main flow of executing user activities.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.