473,396 Members | 1,968 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.

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 1661
>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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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:
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
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
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
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.