Up Property interceptors
DevForce 2010 Resource Center » DevForce development » Model » Property interceptors » Dynamic property interception and the PropertyInterceptorManager

Dynamic property interception and the PropertyInterceptorManager

Last modified on October 27, 2011 13:04

The PropertyInterceptorManager is a singleton, available to the developer via its CurrentInstance property. The current instance is the container for all currently registered interceptor actions. To directly add actions to the PropertyInterceptorManager, use the AddAction method. For example:

C#
PropertyInterceptorManager.CurrentInstance.AddAction(
 new PropertyInterceptorAction<PropertyInterceptorArgs<Entity,Object>>(
   typeof(Entity), null, PropertyInterceptorMode.BeforeSet,
    (args) => Debug.WriteLine("Entity BeforeSet"), 0.0, "A")
);
VB
PropertyInterceptorManager.CurrentInstance.AddAction( _
 New PropertyInterceptorAction(Of PropertyInterceptorArgs(Of Entity, Object)) _
    (GetType(Entity), Nothing, PropertyInterceptorMode.BeforeSet, _
    Function(args) Debug.WriteLine("Entity BeforeSet"), 0.0, "A"))
Created by DevForce on October 07, 2010 14:19

This wiki is licensed under a Creative Commons 2.0 license. XWiki Enterprise 3.2 - Documentation. Copyright © 2015 IdeaBlade