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

C# to VB Conversion Help - Overriding Events?

Hi all,

Is this possible in VB.NET?
/// <summary>
/// We manually implement delegate management, so instead of
/// declaring event variable we declare accessor methods
/// </summary>
public override event BroadcastedMessageHandler
NewBroadcastedMessage
{
add
{
PersistentEventsHelper.AddEventSink
(value,c_NewBroadcastedMessageEvent);
}

remove
{
PersistentEventsHelper.RemoveEventSink
(value,c_NewBroadcastedMessageEvent);
}
}
Sep 26 '06 #1
2 1025
"Spam Catcher" <sp**********@rogers.comschrieb:
Is this possible in VB.NET?

/// <summary>
/// We manually implement delegate management, so instead of
/// declaring event variable we declare accessor methods
/// </summary>
public override event BroadcastedMessageHandler
NewBroadcastedMessage
{
add
{
PersistentEventsHelper.AddEventSink
(value,c_NewBroadcastedMessageEvent);
}

remove
{
PersistentEventsHelper.RemoveEventSink
(value,c_NewBroadcastedMessageEvent);
}
}
Yes, it's possible in VB 2005 (not in previous version!). Check out 'Custom
Event'.

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

Sep 26 '06 #2
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in
news:#O**************@TK2MSFTNGP06.phx.gbl:
Yes, it's possible in VB 2005 (not in previous version!). Check out
'Custom Event'.
That's what I thought - couldn't find anything for .NET 1.1.

In the end, rewrote the call as 2 sub (add/remove)... works just as well.
Sep 26 '06 #3

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

Similar topics

3
by: Ali Eghtebas | last post by:
Hi, I have 3 questions regarding the code below: 1) Why can't I trap the KEYDOWN while I can trap KEYUP? 2) Is it correct that I use Return True within the IF-Statement? (I've already read...
8
by: Edward Diener | last post by:
Is it possible for a derived class to override a property and/or event of its base class ?
1
by: Robert | last post by:
Hi, I've inherited the XmlDocument class to include some custom methods that I want to use on a particular XML file. I need to know whether the document has changed since being loaded, and I...
6
by: Mike | last post by:
Hi, I have such problem: On my form I have TabControl. I want to move from one tab to another using "Next" and "Prev" button. This part works fine. But control also supports switching between...
4
by: Phill. W | last post by:
Here's a knotty little problem. I have some nasty little controls that needs to behave in a non- windows-Standard way - don't ask why; it's a large application being converted from some older...
2
by: Ryan Adler | last post by:
I have a terrible headache from this problem. Perhaps someone can help. My XML is formatted like this: <events> <event> <starts-at>123456<starts-at/> <event> ... <events/>
1
by: Sin Jeong-hun | last post by:
When you create a new C# project, Visual Studio creates a main form for you. If you double click it, the Visual Studio automatically adds an event handler for the form's Load event. Then you can...
4
by: Ty | last post by:
Hello all, I am creating a website in VS 2008 VB.net. On one of my pages I am using the Table control to make a type of calendar a IN/OUT board. The problem I found after I wrote all the code...
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...
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
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
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...

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.