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

Events with return types

I am using a library provided by a software supplier. One of the
examples in the user's guide shows this:

A class level variable with events:
Private WithEvents EvalIterator As Evaluator

Evaluator is a class that exposes only one event.
This is the definiton of the event in Evaluator Class (found in the
object browser):

Public Event OnEvaluate(ByVal evaluator As SupplierLibrary.Evaluator)
As SupplierLibrary.Engine_Action

The example has this event handler:

Private Function EvalIterator_OnEvaluate(ByVal evaluator As Evaluator)
As Engine_Action Handles EvalIterator.OnEvaluate

'code goes here

Return Engine_Action.Continue
End Function

Question: I understood events can not have return types. How this
library could do it?

Mar 10 '06 #1
1 929
eb*********@xstratacoal.com wrote:
I am using a library provided by a software supplier. One of the
examples in the user's guide shows this:

A class level variable with events:
Private WithEvents EvalIterator As Evaluator

Evaluator is a class that exposes only one event.
This is the definiton of the event in Evaluator Class (found in the
object browser):

Public Event OnEvaluate(ByVal evaluator As SupplierLibrary.Evaluator)
As SupplierLibrary.Engine_Action

The example has this event handler:

Private Function EvalIterator_OnEvaluate(ByVal evaluator As Evaluator)
As Engine_Action Handles EvalIterator.OnEvaluate

'code goes here

Return Engine_Action.Continue
End Function

Question: I understood events can not have return types. How this
library could do it?

The SupplierLibrary is probably written in C#. There are no Sub()
procedures in C#, so they are all by default functions.

Tom
Mar 10 '06 #2

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

Similar topics

3
by: Sasha | last post by:
Hi everyone, Here is my problem: I have the following classes: - DataNode - this class is designed to hold some data and will be contained in a tree like data structure DataTree. When...
3
by: Rick Strahl [MVP] | last post by:
I'm working on an app that's using the WebBrowser control. I got the control working fine, hooking to the document object. But I've run into a major issue with hooking the Document events....
5
by: aaj | last post by:
Hi I'm an OOP newbie and working my way through some of the concepts of .NET and c#. I'm looking at messaging between objects using events, but having a few problems generating them. This is...
1
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting,...
3
by: HL | last post by:
The requirement is to send some information to other objects. The objects to whom the information has to be sent is not available at compile time. The names of the types (objects) will be provided...
16
by: anonymous.user0 | last post by:
The way I understand it, if I have an object Listener that has registered as a listener for some event Event that's produced by an object Emitter, as long as Emitter is still allocated Listener...
30
by: Burkhard | last post by:
Hi, I am new to C# (with long year experience in C++) and I am a bit confused by the language construct of events. What is it I can do with events that I cannot do with delegates? At the moment...
5
by: Daniel | last post by:
Hey guys When you hook an event (c# 2.0 syntax): myEvent += MyMethodToFire; You need to also unsubscribe it to avoid a resource leak so that the object it is in gets garbage collected like so...
11
by: MikeT | last post by:
This may sound very elementary, but can you trap when your object is set to null within the object? I have created a class that registers an event from an object passed in the constructor. When...
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...
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
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.