От: | _FRED_ | @ViIvanov | |
Дата: | 29.09.06 06:31 | ||
Оценка: | 37 (2) +1 |
SDB>A generic class for providing thread-safe invocation of delegates. Can be used for (but not limited to) updating GUI elements from another thread.
InvocationHelper<EventHandler>.Invoke(
new EventHandler(delegate {
outputTextBox.Text = serialPort.ReadExisting();
})
);
InvocationHelper.Invoke(new EventHandler(delegate {
outputTextBox.Text = serialPort.ReadExisting();
}));
InvocationHelper.Invoke<EventHandler>(delegate {
outputTextBox.Text = serialPort.ReadExisting();
});