Hi Lucius,
Regarding on the central property setting event hooking request, based on
my understanding, so far we have to manually add some code to monitor all
the properties's get/set operations. This is because there is no built-in
pipeline or channel chain (for property setting/getting) for normal .NET
framework classes. If you do want to make your classes have such ability,
you can consider the following approaches:
** Add a event handler for your class that will react on propery get or
set. And in each of your class property's getter or setter, manually add
code to raise that event (and invoke the eventhandler).
** Or you can always use a central method or property to get/set other
properties(using reflection code in it). Thus, you can put your event
hooking code in that central place:
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=646
BTW, there is another AOP like approach for you to define a proxy class
which will router any method calls to the backend real class instance.
However, using this maybe a bit to expensive for your scenario here. Just
mention it for your refererence:
#Aspect Oriented Programming using .NET - AOP in C#
http://www.developerfusion.co.uk/show/5307/3/
http://www.ayende.com/Blog/archive/2007/07/02/7-Approaches-for-AOP-in-.Net.a
spx
Hope this helps some.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.