T
Tom Shelton
Tom Shelton said:vanderghast wrote:
C# won't use an array of string, but a list of string, in the first
place:
I think you missed the point, ReDim Preserve does have a direct
equivalent
(Array.Resize). It's the indexed property that's more challenging in C#
(you need to return a helper object).
Why would you need a helper object - it's simple index property:
public string this[int index]
{
get{...}
set{...}
}
You've lost the property name. C# indexes objects, not properties. So you
need the property to return a helper object that is in turn indexed (using
the code you showed) to achieve the syntax of a property with an index
argument.
Ah... I see - that's true in this code snipit because the author of the
original didn't declare the Item property as default, which is hte usual
convention. In fact, I just read it that way without noticing that Default
was not there In other words, I really read this as:
Default Public Property Item (ByVal index As Integer) As String
....
End Property
Which would be exactly the same as my C# code. So, it comes down to - did
they mean Default or not