Inheriting from class that inherits from DynamicObject
Posted
by SeveQ
on Stack Overflow
See other posts from Stack Overflow
or by SeveQ
Published on 2010-03-12T15:39:36Z
Indexed on
2010/03/12
20:47 UTC
Read the original article
Hit count: 392
Hello there,
I'm experimenting with C# 4.0's dynamic object model.
I've created an abstract class named "Block" that inherits from DynamicObject. It overrides TryGetMember and TrySetMember.
Furthermore I've created a usable class named "Brush" that inherits from "Block". I want it to be usable dynamically.
But when I create a dynamic object from it and try to access a runtime bound member, it pelts me with an exception telling me that the member doesn't exist. The overridden TryGetMember or TrySetMember methods of the abstract parent class aren't getting called.
Is this behaviour to be expected?
Thank you!
© Stack Overflow or respective owner