473,498 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# to VB.NET code snippet migration help

I'm trying to convert a class to VB.NET code from C#.

public class SomeClassCollection : CollectionBase {
public SomeClass this[int index] {
get {return((SomeClass)List[index]);}
set {List[index] = value;}
}
}

I'm not sure how to convert this. Can't use "Me" on this.
-sandor

Nov 21 '05 #1
4 2808
Public Class SomeClassCollection
Inherits CollectionBase

Default Public Property Item(index As Integer) As SomeClass
Get
Return CType(List(index), SomeClass)
End Get
Set
List(index) = value
End Set
End Property
End Class

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
--
"Sandor Pakh" <sa****@us-installations.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I'm trying to convert a class to VB.NET code from C#.

public class SomeClassCollection : CollectionBase {
public SomeClass this[int index] {
get {return((SomeClass)List[index]);}
set {List[index] = value;}
}
}

I'm not sure how to convert this. Can't use "Me" on this.
-sandor

Nov 21 '05 #2
Thank You :)
So, "this" translates to "Item" as a DEFAULT Property. I learn something new
everyday.
-sandor

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:OR*************@TK2MSFTNGP15.phx.gbl...
| Public Class SomeClassCollection
| Inherits CollectionBase
|
| Default Public Property Item(index As Integer) As SomeClass
| Get
| Return CType(List(index), SomeClass)
| End Get
| Set
| List(index) = value
| End Set
| End Property
| End Class
|
| --
| OHM ( Terry Burns ) * Use the following to email me *
|
| Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
| For i As Int32 = 0 To ch.Length - 1
| ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
| Next
| Process.Start("mailto:" & New String(ch))
| --
|
|
| "Sandor Pakh" <sa****@us-installations.com> wrote in message
| news:%2****************@TK2MSFTNGP09.phx.gbl...
| > I'm trying to convert a class to VB.NET code from C#.
| >
| > public class SomeClassCollection : CollectionBase {
| > public SomeClass this[int index] {
| > get {return((SomeClass)List[index]);}
| > set {List[index] = value;}
| > }
| > }
| >
| > I'm not sure how to convert this. Can't use "Me" on this.
| > -sandor
| >
| >
| >
|
|
Nov 21 '05 #3
"Sandor Pakh" <sa****@us-installations.com> schrieb:
I'm trying to convert a class to VB.NET code from C#.

In addition to the other replies:

Converting code between .NET programming languages
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=languageconverters>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #4
Oh, these links are great. Now I don't have to flood this newsgroup with
silly syntax questions.
Thanks.
-sandor

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uk**************@TK2MSFTNGP10.phx.gbl...
| "Sandor Pakh" <sa****@us-installations.com> schrieb:
| > I'm trying to convert a class to VB.NET code from C#.
|
|
| In addition to the other replies:
|
| Converting code between .NET programming languages
| <URL:http://dotnet.mvps.org/dotnet/faqs/?id=languageconverters>
|
| --
| Herfried K. Wagner [MVP]
| <URL:http://dotnet.mvps.org/>
Nov 21 '05 #5

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

Similar topics

9
2108
by: Paddy McCarthy | last post by:
Frustrated at being prevented from using Python at work I went gunning for Perl. Time to roll out some useless Google statistics to make me feel better Google Phrase count...
4
19966
by: susmita_ganguly | last post by:
Hi I am trying to upgrade from oracle 8i to oracle 9i on the same server ..I don't know much abt migration . Can anyone help me out. Thanks. Susmita
4
3958
by: Abram Friesen | last post by:
Hi, I'm a developer for a software application vendor, and our application makes use of a customer-maintained Oracle 8i/9i database. We've had a customer request to support DB2 database, and I'm...
2
1889
by: aww91 | last post by:
Company is planning a Sybase to UDB migration that is projected to take 1 year. During that long period of time any Code Freeze put into place would impact our users (we normally release code...
18
3136
by: Joe Fallon | last post by:
I have some complex logic which is fairly simply to build up into a string. I needed a way to Eval this string and return a Boolean result. This code works fine to achieve that goal. My...
1
2048
by: pankaj_wolfhunter | last post by:
Greeting, Can anyone tell me the points to keep in mind while migrating data from Sybase to DB2 especially in case of LOB data. I know the books available on the IBM site, but if still someone can...
1
3840
by: Bonggoy Cruz | last post by:
We have a fairly big size ASP.NET web application that was written VB.NET. We are in the process converting the web project. We used the migration wizard included in VS 2005. I followed step by...
13
2268
by: frk.won | last post by:
I am interested in learning how to use the VS 2005 code snippets. However, I wish to know what are the best ways to source control the code snippets? Are there any source safe/subversion...
9
4181
by: Troels Arvin | last post by:
At work, some people have found IBM's Migration Toolkit (MTK) to be a nice tool for copying data from one table (in another DBMS product) to DB2. Now, they want to do the same thing from one DB2...
0
7165
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
7203
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...
1
6885
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
7379
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
5462
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,...
1
4908
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4588
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1417
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.