473,404 Members | 2,187 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,404 software developers and data experts.

Does delegate instantiate an instance of Delegate or MultiCastDele

The documentation for the Delegate and the MultiCastDelegate classes tell me
that when we have a line like:

public delegate void CheckAndPrintDelegate(string str);

it causes the compiler to generate a new delegate class named
CheckAndPrintDelegate that inherits from System.MulticastDelegate.

Elsewhere it says the same delegate definition produces a delegate class
inheriting from System.Delegate.

Under what condition does this construct create an instance of
System.Delegate and under what condition does it create an instance of
System.MulticastDelegate?

Thanks

Nima Dilmaghani

Nov 17 '05 #1
2 1413
Hi,
the complete explanation to your question is this :
http://209.34.241.67/brada/archive/2004/2/5.aspx. You see there that we can
never inherit from system.delegate directly. Since Brad said that we should
pretend that only multicastdelegate exists so this means that always an
instance of multicastdelegate is created for us, & because its internally
inheriting from system.delegate so while wrting it would be valid to say that
its an instance of system.delegate, but its actually system.multicastdelegate.

Regards,

Abubakar.
http://joehacker.blogspot.com

"Nima" wrote:
The documentation for the Delegate and the MultiCastDelegate classes tell me
that when we have a line like:

public delegate void CheckAndPrintDelegate(string str);

it causes the compiler to generate a new delegate class named
CheckAndPrintDelegate that inherits from System.MulticastDelegate.

Elsewhere it says the same delegate definition produces a delegate class
inheriting from System.Delegate.

Under what condition does this construct create an instance of
System.Delegate and under what condition does it create an instance of
System.MulticastDelegate?

Thanks

Nima Dilmaghani

Nov 17 '05 #2
Thanks Abubakar. It is now clear.

"Abubakar" wrote:
Hi,
the complete explanation to your question is this :
http://209.34.241.67/brada/archive/2004/2/5.aspx. You see there that we can
never inherit from system.delegate directly. Since Brad said that we should
pretend that only multicastdelegate exists so this means that always an
instance of multicastdelegate is created for us, & because its internally
inheriting from system.delegate so while wrting it would be valid to say that
its an instance of system.delegate, but its actually system.multicastdelegate.

Regards,

Abubakar.
http://joehacker.blogspot.com

"Nima" wrote:
The documentation for the Delegate and the MultiCastDelegate classes tell me
that when we have a line like:

public delegate void CheckAndPrintDelegate(string str);

it causes the compiler to generate a new delegate class named
CheckAndPrintDelegate that inherits from System.MulticastDelegate.

Elsewhere it says the same delegate definition produces a delegate class
inheriting from System.Delegate.

Under what condition does this construct create an instance of
System.Delegate and under what condition does it create an instance of
System.MulticastDelegate?

Thanks

Nima Dilmaghani

Nov 17 '05 #3

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

Similar topics

4
by: Uchiha Jax | last post by:
Hello everyone, I am a plenty silly person who is trying to learn .NET remoting through trial and error (all articles I read are going over my head at the moment (mostly) so I thought i'd give...
4
by: KC Eric | last post by:
Hi all, I have a dll file, it has a class, say: class Temp, this class has a function which has a delegate as a parameter, say: public void Test(GameOverHandler _overHandler)
4
by: pz0071 | last post by:
G'day, I think I got my head around using delegates, particularily when updating the user interface from another thread. I got it all sussed, just not 100% sure on the correct syntax for...
3
by: Minh Khoa | last post by:
Please give me more information about delegate and its usage? Why do i use it and when?
5
by: needin4mation | last post by:
Learning about delegates (again, I admit), I think I finally get it, maybe. I can reference any method in any class in the same namespace as long as it has the same signature. Right? But how...
8
by: KnighT | last post by:
I have a .net service that runs a System.Threading.Timer. The delegate points to the function that the service should execute when the timer elapses. Problem: The timer is not ticking. I have...
5
by: Carl Johansson | last post by:
Suppose I have a delegate variable, what is the difference between the following two statements? DelegateType methodPointer = new DelegateType(SomeMethod); and... DelegateType methodPointer...
3
by: John Dalberg | last post by:
I have seen examples for List<T>.FindAll(findthis)where findthis is a predicate. How do I pass a parameter to this predicate so that I have different values to search for? I don't want to use...
26
by: raylopez99 | last post by:
Here is a good example that shows generic delegate types. Read this through and you'll have an excellent understanding of how to use these types. You might say that the combination of the generic...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.