B
Bruno Neves Pires Silva
Hello, Programmers.
How can I access a member of an object using generics?
I've got the following problem:I Have a class that uses generics like
below:
class ClassName<typename>
{
public void method(typename var)
{
var.Method2(); //I've got an error here.
}
}
How can I Access Method2 from the class typename ???
in VB.Net its easy:
Class ClassName(Of typename)
public sub method(byval var as typename)
Dim obj As Object = var
obj.Method2()
end sub
End Class
Thanks in advance.
How can I access a member of an object using generics?
I've got the following problem:I Have a class that uses generics like
below:
class ClassName<typename>
{
public void method(typename var)
{
var.Method2(); //I've got an error here.
}
}
How can I Access Method2 from the class typename ???
in VB.Net its easy:
Class ClassName(Of typename)
public sub method(byval var as typename)
Dim obj As Object = var
obj.Method2()
end sub
End Class
Thanks in advance.