473,398 Members | 2,125 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.

Help with Translation from C# to VB.NET

Hello,

In C# I have seen subs overload each other that have the same signature. For example:

void IPostBackDataHandler.RaisePostDataChangedEvent()
{
((BasePostBackControl)this).RaisePostDataChangedEv ent();
}

protected virtual void RaisePostDataChangedEvent()
{
}

To trasnlate this to VB.NET I came up with this:
Public Sub RaisePostDataChangedEvent() Implements IPostBackDataHandler.RaisePostDataChangedEvent
CType(Me, BasePostBackControl).RaisePostDataChangedEvent()
End Sub

Protected Overridable Sub RaisePostDataChangedEvent()
End Sub

Ofcourse I get the error that both have identical signatures. So, I rewrite them to this:

Public Overridable Sub RaisePostDataChangedEvent() Implements IPostBackDataHandler.RaisePostDataChangedEvent
End Sub

It clears up the Identical Signature problem but then the class that overrides this sub end up with different access level errors. And if I go with:

Protected Overridable Sub RaisePostDataChangedEvent()
End Sub

My IPostBackDataHandler implementation is in error. So my question is. How can I handle this in VB.NET?

Thanks for any help,

AM


Jul 21 '05 #1
2 1662
>My IPostBackDataHandler implementation is in error. So my question is. How can I handle this in VB.NET?

Implement IPostBackDataHandler.RaisePostDataChangedEvent under a
different name, that's what the C# code does.

Private Sub IPostBackDataHandler_RaisePostDataChangedEvent()
Implements IPostBackDataHandler.RaisePostDataChangedEvent
CType(Me, BasePostBackControl).RaisePostDataChangedEvent()
End Sub

Protected Overridable Sub RaisePostDataChangedEvent()
End Sub

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jul 21 '05 #2
Thanks that did the trick.

Jul 21 '05 #3

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

Similar topics

0
by: Anuj Mathur | last post by:
Hello All We are making an application for translating the literals (HTML text and labels) of an existing ASP website from English to another language, say Swedish. Now, for this we are...
7
by: ark | last post by:
Hi, If I got it right, C++ deprecates using 'static' keyword for internal linkage in favor of a namespace. I don't understand the equivalence though: namespace assignment does not mechanically...
7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
9
by: tiger79 | last post by:
Hi, I've been translating some API's from VB to C# for a couple of days now. Only I'm a real newbie to both languages, but I managed to do most of it except the next statements, so if anyone knows...
33
by: Martin Jørgensen | last post by:
Hi, In continuation of the thread I made "perhaps a stack problem? Long calculations - strange error?", I think I now got a "stable" error, meaning that the error always seem to come here now...
0
by: won | last post by:
Job Type: Part-time Proofreading Languages: English, German, French, Italian, Spanish etc. Company Profile: Won Translation Organization is a translation company located in China. As a...
15
by: 3than7 | last post by:
I am new to C++. but i have a practical problem that i am fairly certain can be solved with C++ I am a student and am taking Latin. I want a program that will allow me to input the english word...
0
by: PopeDarren | last post by:
_Short version_: Is it possible to directly access the hyperlink objects in the MenuItem and TreeNode objects on the server-side? If so, how do I do it? _Long version_: I'm getting to the end...
0
by: Stef Mientki | last post by:
hello, I've build a translation tool, to translate all strings in a python source file. As a extra gadget I added translation through Babel Fish, using beautifulsoup. Although it works...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.