Hi,
Reflection is great and powerful... I think that time consuming it is not
perceivable in commercial applications.
There is a function GetType that allow me get the Name of a type as string.
Ex:
Dim TypeName as String = GetType(MyType).Name --> return
"MyType"
what I am trying to do, but I not sure that is possible, is something like
this.
Dim PropertyName as String = GetMemberInfo(MyType.MyProperty).Name --->
return "MyProperty"
Properties on my busines objects contains custom attributes.
Ex:
<Serializable(), Entity(TableStorage:="ANALISIS", Description:="Analisis")>
_
Public Class Analisis : Inherits BusinessBase
.....
<Entity(DataField:="ANA_PUNTO_INGRESO", Key:=1, IsRequired:=True)> _
Public Property PuntoIngreso() As Integer
Get
Return mPuntoIngreso
End Get
Set(ByVal Value As Integer)
mPuntoIngreso = Value
End Set
End Property
End Class
I want to be able to retrieve DataField attrib of any property without using
the property name as string. For this reason I need a function that does
this for me.
Antonio
"Cor Ligthert [MVP]" <no************@planet.nl> escribió en el mensaje
news:eZ**************@TK2MSFTNGP09.phx.gbl...
Antonio,
You are using reflection (late binding). With that it gets its information
at runtime. Why would you use this time consuming method, while you want
in fact strong typed names.
Just don't use late binding and don't even use collections.
Just my thought,
Cor