473,322 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Delegates/Messaging Uncoupling Threaded Applications

I currently have a .NET Form application which has a seperate thread invoking
delegates of the MainForm in order to have the main thread update the form's
controls.

I would like to move the secondary thread's behavior into another class, eg.
MyClass, but I would like MyClass to be completely uncoupled from the form,
so that it might be re-used in another application setting, eg. a service.

What is the .NET paradigm for "communicating" between objects, so that I
don't have to include, for instance, references to a delegate of a MainForm
method within MyClass? Or am I ignorant of some feature of the .NET delegate
paradigm?

Any help, or directions to reading, would be greatly appreciated.

--
James Smyth

--
James Smyth
Sep 30 '05 #1
1 1122
James Smyth <Ja********@discussions.microsoft.com> wrote:
I currently have a .NET Form application which has a seperate thread invoking
delegates of the MainForm in order to have the main thread update the form's
controls.

I would like to move the secondary thread's behavior into another class, eg.
MyClass, but I would like MyClass to be completely uncoupled from the form,
so that it might be re-used in another application setting, eg. a service.

What is the .NET paradigm for "communicating" between objects, so that I
don't have to include, for instance, references to a delegate of a MainForm
method within MyClass? Or am I ignorant of some feature of the .NET delegate
paradigm?

Any help, or directions to reading, would be greatly appreciated.


Delegates don't need to be tied to any particular class. EventHandler
is a good example of this - any class can use it, any class can create
one.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Oct 1 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: axxegfx | last post by:
newbie delegates question i'm using this code: sub empezar() Dim del As MyDelSub Dim del2 As MyDelSub Dim delAll As del = New MyDelSub(AddressOf hilo1) del2 = New MyDelSub(AddressOf hilo2)
0
by: AMDIRT | last post by:
I have been putting it off, but I think i need to become better versed in delegates. I have been reading about them and I am unable to discern how to use them or when to use. It would seem to...
4
by: Bob Rock | last post by:
Hello, I was wondering if callback delegates, called in response to a event, are executed in their own thread. I was suspecting the OS might spawn a new thread and have the delegate execute in...
4
by: LP | last post by:
Hello! I am still transitioning from VB.NET to C#. I undertand the basic concepts of Delegates, more so of Events and somewhat understand AsyncCallback methods. But I need some clarification on...
0
by: James Smyth | last post by:
I currently have a .NET Form application which has a seperate thread invoking delegates of the MainForm in order to have the main thread update the form's controls. I would like to move the...
4
by: Beren | last post by:
Hello I'm trying to use Cache expiration and its callback feature to easily add automated tasks programmatically. The task should be run when the Cache object expired The problem I'm facing...
14
by: Lior Amar | last post by:
Quick question about threads and delegates. I have the following scenario Thread A (CLASSA) spawns Thread B (CLASSB) and passes it a DelegateA to a callback Thread B Invokes a DelegateB...
4
by: Jarod_24 | last post by:
What is the point with Delegates in VB.Net What can these things do that we can not allready do with the use of Interfaces, Events and Event handlers and so on... I'd like a discussion on this,...
1
by: James Smyth | last post by:
I currently have a .NET Form application which has a seperate thread invoking delegates of the MainForm in order to have the main thread update the form's controls. I would like to move the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.