T
Thomas Due
Hi,
I have a class which monitors a TCP socket. This will on occasion raise an event which can be handled by a GUI.
Now, I am aware of the
if(InvokeRequire) {
EventHandler d = new EventHandler();
Invoke(d, new object[]{sender, e});
} else {
...
}
structure, but I was wondering if there is a way to avoid it?
The way I raise the events is like this:
// declaration in thread class
public event EventHandler<CustomEventArgs> EventHappening;
// Usage in thread class
if (somethingorotherhappening)
if (EventHappening != null)
EventHappening(this, new CustomEventArgs());
Thank you in advance.
--
Thomas Due
Posted with XanaNews version 1.18.1.6
"Digressions, objections, delight in mockery, carefree mistrust are
signs of health; everything unconditional belongs in pathology."
-- Friedrich Nietzsche
I have a class which monitors a TCP socket. This will on occasion raise an event which can be handled by a GUI.
Now, I am aware of the
if(InvokeRequire) {
EventHandler d = new EventHandler();
Invoke(d, new object[]{sender, e});
} else {
...
}
structure, but I was wondering if there is a way to avoid it?
The way I raise the events is like this:
// declaration in thread class
public event EventHandler<CustomEventArgs> EventHappening;
// Usage in thread class
if (somethingorotherhappening)
if (EventHappening != null)
EventHappening(this, new CustomEventArgs());
Thank you in advance.
--
Thomas Due
Posted with XanaNews version 1.18.1.6
"Digressions, objections, delight in mockery, carefree mistrust are
signs of health; everything unconditional belongs in pathology."
-- Friedrich Nietzsche