开发者

.NET 3.5 Reflection Help

Sup Guys,

On my Bussiness Layer, I have something like

Dim object as New ExampleObject

Where ExampleObject inherits BaseExampleObject.

I want to know how can I access ExampleObject Propert开发者_高级运维ies by reflection on my BaseExampleObject.

Something like:

MyBase.GetType.GetProperty("PropertyName").GetValue(mybase.gettype, Nothing)

Of course thats not going to work because this is not an instance of an object and if I instantiate a new object, I'll lose the reference from my Bussiness Layer.

Anyone got a hint?

Thanks


cast your BaseExampleObject to ExampleObject:

BaseExampleObject b;
b = new ExampleObject();
((ExampleObject)b).Something();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜