J
JC Voon
Hi :
I'm new to VB and C#, can someone help me to convert this code to VB
1. The following code, what is the 'this' means ?
public object this [int index]
{
get {return ((IDataRecord)myObj)[index];}
}
2. What is the different using 'this' and 'base' ?
public class MyClass
{
public MyClass(int Param1)
: base (Param1, 123)
{
}
// the above block can i change to ..??
//public MyClass(int Param1)
//{
// base.MyClass(Param1, 123)
// }
public MyClass(int Param1, int Param2)
: this (Param1)
{
...
}
}
Is this conversion correct ?
public class MyClass
public sub New(Param1 AS Integer)
MyBase.New(Param1, 123) ' or MyClass.New(Param1, 123) ???
end sub
public sub New(Param1 AS Integer, Param2 AS Integer)
Me.New(Param1, 123)
...
end sub
end class
Thanks
JCVoon
I'm new to VB and C#, can someone help me to convert this code to VB
1. The following code, what is the 'this' means ?
public object this [int index]
{
get {return ((IDataRecord)myObj)[index];}
}
2. What is the different using 'this' and 'base' ?
public class MyClass
{
public MyClass(int Param1)
: base (Param1, 123)
{
}
// the above block can i change to ..??
//public MyClass(int Param1)
//{
// base.MyClass(Param1, 123)
// }
public MyClass(int Param1, int Param2)
: this (Param1)
{
...
}
}
Is this conversion correct ?
public class MyClass
public sub New(Param1 AS Integer)
MyBase.New(Param1, 123) ' or MyClass.New(Param1, 123) ???
end sub
public sub New(Param1 AS Integer, Param2 AS Integer)
Me.New(Param1, 123)
...
end sub
end class
Thanks
JCVoon