473,385 Members | 1,518 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,385 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 1126
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.