C# to VB.NET code snippet migration help

  • Thread starter Thread starter Sandor Pakh
  • Start date Start date
S

Sandor Pakh

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
 
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))
 
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
| 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))
| --
|
|
| | > 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
| >
| >
| >
|
|
 
Back
Top