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

how to use getinvocationlist on an event

Hello again.

My code adds several EventHandlers to the same Event-Delegate. Thereafter
I 'd like to get a list of all the handlers added. I found that events are
some kind of multicast delegates and that it should be possible to get the
list with den GetInvocationList-Method of the Delegate. But I really don't
succeed to do this.

ClickButton is the class that holds the delegate and the event (ClickEvent)
and fires the event.

Sub Main(ByVal CmdArgs() As String)
Dim button As ClickButton = New ClickButton()

AddHandler button.ClickEvent, AddressOf ClickHandler1
AddHandler button.ClickEvent, AddressOf ClickHandler2
AddHandler button.ClickEvent, AddressOf ClickHandler3

'GetInvocationList
End Sub
What is the object on that I can call GetInvocationList???

Thank you
Sincerely
Lore
Nov 21 '05 #1
1 3552
"Lore Leunoeg" <lo*********@gmx.net> schrieb:
My code adds several EventHandlers to the same Event-Delegate. Thereafter
I 'd like to get a list of all the handlers added. I found that events are
some kind of multicast delegates and that it should be possible to get the
list with den GetInvocationList-Method of the Delegate. But I really don't
succeed to do this.


<URL:http://dotnet.mvps.org/dotnet/code/codingtechnique/#EventHandlerCount>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

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

Similar topics

0
by: Andy Read | last post by:
Hello all, I have the requirement to produce source code that produces an object hierarchy. Example: Root | Folder 1
18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
8
by: Mark | last post by:
Hi, I'm looking for some ideas on how to build a very simple Event processing framework in my C++ app. Here is a quick background ... I'm building a multithreaded app in C++ (on Linux) that...
0
by: Martin Hart - Memory Soft, S.L. | last post by:
Hi: Can someone tell me the event equivalent of the Delegate's GetInvocationList()? I wish to enumerate the handlers of an event, but can't see how to do it. TIA, Martin.
2
by: Phil Jones | last post by:
I think I might be missing something simple/stupid - but I'm trying to get the delegates that are listed as event handlers for an event from within an object instance. For example: Namespace...
12
by: Jack Russell | last post by:
My unstanding of all VB up to and including vb6 is that an event could not "interrupt" itself. For instance if you had a timer event containing a msgbox then you would only get one message. ...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
0
by: Jianwei Sun | last post by:
Hi, everyone, I have a couple of delegates in a chain, and the way I called it is like this: Delegate aoArrayOfDelegates = m_oTestMethods.GetInvocationList(); foreach (TestMethod...
9
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
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
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.