473,396 Members | 1,713 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,396 software developers and data experts.

Is it possible to check if there is a handler registered for one of my events?

Hi,

I have a class that provides an event.

Class Test
Public Event MyEvent(ByVal iExpensiveParameter As Integer)
End Class

The problem is, that when the event is raised, a lot of expensive
computation has to be done to calculate the parameter of the event. So I
only would like to do that, if anybody has registered a handler for this
event. Is it possible to find that out?
Thanks in advance,
Andy
Nov 20 '05 #1
1 1630
"Andreas Müller" <an***************@gmx.de> schrieb
I have a class that provides an event.

Class Test
Public Event MyEvent(ByVal iExpensiveParameter As Integer)
End Class

The problem is, that when the event is raised, a lot of expensive
computation has to be done to calculate the parameter of the event. So I
only would like to do that, if anybody has registered a handler for this
event. Is it possible to find that out?


If Not MyEventEvent Is Nothing Then
'expensive computation
RaiseEvent MyEvent(...)
End If
--
Armin

Nov 20 '05 #2

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

Similar topics

4
by: Newbie | last post by:
Is it possible to set up an event handler or something else so that when *any* link on the page is clicked it 'fires-up', executes some JS and then continues to process the link that was clicked?...
2
by: Wiktor Zychla | last post by:
Let's start with an example: if you have: class Test { public delegate int MyDelegate( int n ); event MyDelegate MyEvent; } then you can get MyEvent using reflection:
2
by: mccoyn | last post by:
I would like to be able to change a property of a control without calling the event handler I have registered for it. For example, I would like a function like the following void...
3
by: Boni | last post by:
Dear all, is it not possible to have shred events? Thanks, Boni error BC30600: 'WithEvents' variable does not raise any instance events that are accessible to 'Class A."
5
by: JB | last post by:
I am struggling to figure out a way to allow one element to be dragged, but still capture 'mouseover' events on other elements. I've created a simple example to demonstrate what I mean:...
21
by: Ben | last post by:
Hello I have frames set up in an asp.net application and need one frame to refresh another. Seeing as events need to be registered at the time the page is sent from the server, I was wondering...
51
by: Paul Gorodyansky | last post by:
Hi, Ran into the following problem while trying to have a code to attach a Virtual Keyboard to any user's form: User clicks a button and my JavaScript changes outerHTML of say <textarea -...
4
by: TS | last post by:
i have an issue on page load when sometimes I want to quit processing the page, but the other events get called like page_prerender and individual controls' events get fired. i want to not raise...
4
by: Andrew Ip | last post by:
Hi everyone, I'm trying to dynamically create an image map for a particular image on my website, and I'm running into an issue where I try to register the "mouseover" and "mouseout" events for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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
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
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
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
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,...

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.