List Info

Thread: Raise events




Raise events
user name
2006-04-03 17:52:35
From:    Karl King - TP Technologies <kkingTPTECHNOLOGIES.COM>

>Is is possible to raise an event within a collection
class ?

Well, sure. That's rather ordinary.

But what I think you mean is, is it possible to raise an
event
from within a *member* of a collection class, and actually
have someone receive that event?

The answer again is yes. In fact, in dotNet there are
several
ways to do it.

The way that also worked in VB6 is indirect.

* Collection owner has collection, and also has a proxy
object.
* Each member of the collection has a reference to the proxy
object.
* Collection member calls a method of the proxy object,
which
raises the event. (The specific member involved is probably
a
parameter to the method call and the event.)
* Collection owner receives event from proxy object.

In VB.Net you don't have to worry about circular
references,
so you can just hand the collection member a reference to
the
collection class and have it call methods - which may raise
events
if that's what you need.

Another .Net option is Delegates. This basically lets you
hand
the collection member a reference to a *method* in some
object
(such as the owner of the collection), and the member can
then
call this method. (It's even legal for a class to grant
access to
its own private methods via Delegates. Somehow that makes me
feel a bit twitchy... how do I know that  the collection
member
isn't passing this access around?)

And yet another is AddHandler. This basically says that THIS
method of THIS object will handle THAT event of THAT object
-
and it's object-specific, at run time.

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Can't debug in VS 2005
user name
2006-04-03 21:50:08
We have an ASP.Net Webservice that calls VB.Net class
libraries.  Each
library inherits from the same base object.

In VS 2003,  if the objects are all compiled in debug mode
and the
webservice is compiled in debug mode then it is possible to
step from the
web service code into one of the class libraries and into
the base object.

In VS 2005,  I can step into the class libraries but not
into the base
object.

Any suggestions ?  I am assuming that setting the 'Generate
debug info' to
'Full' (in advanced compiler settings) in VS2005 is
equivalent to setting
the solution's Configuration to 'debug' in VS2003.

TIA

Steve

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )