I've just been tasked to translate a C# project into VB (Dot Net 2.0). I am
somewhat familiar with C# but far from an expert.
I'd like a second opinion on this one.
The project uses CSLA 2.1.4. The project has a class that inherits from
ReadOnlyBase. ReadOnlyBase has a method declaration:
protected virtual void DataPortal_Fetch(object criteria)
{
throw new NotSupportedException(Resources.FetchNotSupportedE xception);
}
The child class has a declaration:
private void DataPortal_Fetch(Criteria criteria)
where Criteria is a local private class.
(I am aware that this declaration is taking advantage of C#'s case
sensitivity. VS appears to have no problem with this declaration.)
In the VB version of CSLA, the declaration is:
Protected Overridable Sub DataPortal_Fetch(ByVal criteria As Object)
Throw New NotSupportedException(My.Resources.FetchNotSupport edException)
End Sub
What I am uncertain of is how to translate the declaration of the inheriting
class DataPortan_Fetch declaration.
If I try to do a direct translation, taking into account lack of case
sensitivity:
Private Sub DataPortal_Fetch(ByVal criteria1 As Criteria)
I get a warning: sub 'DataPortal_Fetch' shadows an overridable method in the
base class 'ReadOnlyBase'. To override the base method, this method must be
declared 'Overrides'.
The alternative, which eliminates the warning would appear to be:
Protected Overrides Sub DataPortal_Fetch(ByVal criteria1 As Object)
I would then do a ctype within the sub when it becomes necessary to access
the properties of the class Criteria.
Which would be the more accurate method? 3 1256
Hi,
Try:
Private Overloads Sub DataPortal_Fetch(ByVal criteria As Criteria)
"B. Chernick" <BC*******@discussions.microsoft.comwrote in message
news:23**********************************@microsof t.com...
I've just been tasked to translate a C# project into VB (Dot Net 2.0). I
am
somewhat familiar with C# but far from an expert.
I'd like a second opinion on this one.
The project uses CSLA 2.1.4. The project has a class that inherits from
ReadOnlyBase. ReadOnlyBase has a method declaration:
protected virtual void DataPortal_Fetch(object criteria)
{
throw new
NotSupportedException(Resources.FetchNotSupportedE xception);
}
The child class has a declaration:
private void DataPortal_Fetch(Criteria criteria)
where Criteria is a local private class.
(I am aware that this declaration is taking advantage of C#'s case
sensitivity. VS appears to have no problem with this declaration.)
In the VB version of CSLA, the declaration is:
Protected Overridable Sub DataPortal_Fetch(ByVal criteria As Object)
Throw New
NotSupportedException(My.Resources.FetchNotSupport edException)
End Sub
What I am uncertain of is how to translate the declaration of the
inheriting
class DataPortan_Fetch declaration.
If I try to do a direct translation, taking into account lack of case
sensitivity:
Private Sub DataPortal_Fetch(ByVal criteria1 As Criteria)
I get a warning: sub 'DataPortal_Fetch' shadows an overridable method in
the
base class 'ReadOnlyBase'. To override the base method, this method must
be
declared 'Overrides'.
The alternative, which eliminates the warning would appear to be:
Protected Overrides Sub DataPortal_Fetch(ByVal criteria1 As Object)
I would then do a ctype within the sub when it becomes necessary to access
the properties of the class Criteria.
Which would be the more accurate method?
It does eliminate the warning. Thanks!
(Of course I'm still trying to understand the original intent of the C# code.)
"Bill McCarthy" wrote:
Hi,
Try:
Private Overloads Sub DataPortal_Fetch(ByVal criteria As Criteria)
"B. Chernick" <BC*******@discussions.microsoft.comwrote in message
news:23**********************************@microsof t.com...
I've just been tasked to translate a C# project into VB (Dot Net 2.0). I
am
somewhat familiar with C# but far from an expert.
I'd like a second opinion on this one.
The project uses CSLA 2.1.4. The project has a class that inherits from
ReadOnlyBase. ReadOnlyBase has a method declaration:
protected virtual void DataPortal_Fetch(object criteria)
{
throw new
NotSupportedException(Resources.FetchNotSupportedE xception);
}
The child class has a declaration:
private void DataPortal_Fetch(Criteria criteria)
where Criteria is a local private class.
(I am aware that this declaration is taking advantage of C#'s case
sensitivity. VS appears to have no problem with this declaration.)
In the VB version of CSLA, the declaration is:
Protected Overridable Sub DataPortal_Fetch(ByVal criteria As Object)
Throw New
NotSupportedException(My.Resources.FetchNotSupport edException)
End Sub
What I am uncertain of is how to translate the declaration of the
inheriting
class DataPortan_Fetch declaration.
If I try to do a direct translation, taking into account lack of case
sensitivity:
Private Sub DataPortal_Fetch(ByVal criteria1 As Criteria)
I get a warning: sub 'DataPortal_Fetch' shadows an overridable method in
the
base class 'ReadOnlyBase'. To override the base method, this method must
be
declared 'Overrides'.
The alternative, which eliminates the warning would appear to be:
Protected Overrides Sub DataPortal_Fetch(ByVal criteria1 As Object)
I would then do a ctype within the sub when it becomes necessary to access
the properties of the class Criteria.
Which would be the more accurate method?
B. Chernick wrote:
It does eliminate the warning. Thanks!
(Of course I'm still trying to understand the original intent of the C# code.)
That's the intent of the original code. You simply don't have to specify
with a keyword that you are overloading a method in C#.
--
Göran Andersson
_____ http://www.guffa.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Bengt Richter |
last post by:
Just thought None as the first argument would be both handy and mnemonic,
signifying no translation, but allowing easy expression of deleting characters,
e.g.,
s = s.translate(None,...
|
by: shank |
last post by:
I'm sure this is a stretch, but is there some kind of component that I could
install to translate from English to Spanish on the fly? I have a lot of
equipment features and specifications that I...
|
by: Gadrin77 |
last post by:
I have data that looks like
<Root>
<Main Value="Line1|Line2.|Line3|Line4.|Line5"/>
</Root>
I'm using
Translate(@Value, "|.", ",")
|
by: Johnny Lee |
last post by:
Hi,
First, I want to know whether the python interpreter translate the
code directly into machine code, or translate it into C then into
machine code?
Second, if the codes are translated directly...
|
by: kennethfine |
last post by:
I'm transitioning from ASP development, please excuse
these basic questions. One thing I did often in ASP was
create a "translate" function to render one string to
another, strip out excess...
|
by: bobueland |
last post by:
The module string has a function called translate. I tried to find the
source code for that function. In:
C:\Python24\Lib
there is one file called
string.py
I open it and it says
|
by: peterbe |
last post by:
This has always worked fine for me.
Peter fine
Now if I do it with a unicode string:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/string.py", line...
|
by: bvdet |
last post by:
I have done some more work on a simple class I wrote to calculate a global coordinate in 3D given a local coordinate:
## Basis3D.py Version 1.02 (module macrolib.Basis3D)
## Copyright (c) 2006...
|
by: Kenneth McDonald |
last post by:
I have the need to occasionally translate a single word
programatically. Would anyone have a Python script that would let me
do this using Google (or another) translation service?
Thanks,
Ken
|
by: kovariadam |
last post by:
Hi,
Does anybody know why i get this error:
SQL0176N The second, third or fourth argument of the TRANSLATE scalar
function is incorrect. SQLSTATE=42815
with this query:
SELECT...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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
|
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...
|
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...
|
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...
| |