Hello,
I am trying to convert some of my old VB.NET code to C# using an
online tool but I am getting an error:
Default Public Overloads Property Item(ByVal index As Integer)
As Element
Get
Return TryCast(MyBase. BaseGet(index), Element)
End Get
Set(ByVal value As Element)
If MyBase.BaseGet( index) IsNot Nothing Then
MyBase.BaseRemo veAt(index)
End If
Me.BaseAdd(inde x, value)
End Set
End Property ' Item
Becomes:
public ConfigElement Item {
get { return base.BaseGet(in dex) as ConfigElement; }
set {
if (base.BaseGet(i ndex) != null) {
base.BaseRemove At(index);
}
this.BaseAdd(in dex, value);
}
}
index disappears as input. Can't I use it?
Thanks,
Miguel
I am trying to convert some of my old VB.NET code to C# using an
online tool but I am getting an error:
Default Public Overloads Property Item(ByVal index As Integer)
As Element
Get
Return TryCast(MyBase. BaseGet(index), Element)
End Get
Set(ByVal value As Element)
If MyBase.BaseGet( index) IsNot Nothing Then
MyBase.BaseRemo veAt(index)
End If
Me.BaseAdd(inde x, value)
End Set
End Property ' Item
Becomes:
public ConfigElement Item {
get { return base.BaseGet(in dex) as ConfigElement; }
set {
if (base.BaseGet(i ndex) != null) {
base.BaseRemove At(index);
}
this.BaseAdd(in dex, value);
}
}
index disappears as input. Can't I use it?
Thanks,
Miguel
Comment