|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Linq; |
| 4 | +using System.Text; |
| 5 | +using System.Threading.Tasks; |
| 6 | + |
| 7 | +namespace CefSharp.ModelBinding |
| 8 | +{ |
| 9 | + /// <summary> |
| 10 | + /// Provides the capability intercepting get/set property calls made from javascript as part of the |
| 11 | + /// JavascriptBinding (JSB) implementation. |
| 12 | + /// </summary> |
| 13 | + public interface IPropertyInterceptor |
| 14 | + { |
| 15 | + /// <summary> |
| 16 | + /// Called before the get property is invokved. You are now responsible for evaluating |
| 17 | + /// the property and returning the result. |
| 18 | + /// </summary> |
| 19 | + /// <param name="propertyGetter">A Func that represents the property to be called</param> |
| 20 | + /// <param name="propertName">Name of the property to be called</param> |
| 21 | + /// <returns>The property result</returns> |
| 22 | + /// <example> |
| 23 | + /// <code> |
| 24 | + /// <![CDATA[ |
| 25 | + /// public object IPropertyInterceptor.InterceptGet(Func<object> propertyGetter, string propertyName) |
| 26 | + /// { |
| 27 | + /// object result = propertyGetter(); |
| 28 | + /// Debug.WriteLine("InterceptGet " + propertyName); |
| 29 | + /// return result; |
| 30 | + /// } |
| 31 | + /// ]]> |
| 32 | + /// </code> |
| 33 | + /// </example> |
| 34 | + object InterceptGet(Func<object> propertyGetter, string propertName); |
| 35 | + |
| 36 | + /// <summary> |
| 37 | + /// Called before the set property is invokved. You are now responsible for evaluating |
| 38 | + /// the property. |
| 39 | + /// </summary> |
| 40 | + /// <param name="propertySetter">A Func that represents the property to be called</param> |
| 41 | + /// <param name="parameter">paramater to be set to property</param> |
| 42 | + /// <param name="propertName">Name of the property to be called</param> |
| 43 | + /// <example> |
| 44 | + /// <code> |
| 45 | + /// <![CDATA[ |
| 46 | + /// public object IPropertyInterceptor.InterceptSet(Action<object> propertySetter, object parameter, string propertName) |
| 47 | + /// { |
| 48 | + /// Debug.WriteLine("InterceptSet " + propertName); |
| 49 | + /// propertySetter(parameter); |
| 50 | + /// } |
| 51 | + /// ]]> |
| 52 | + /// </code> |
| 53 | + /// </example> |
| 54 | + void InterceptSet(Action<Object> propertySetter, object parameter, string propertName); |
| 55 | + } |
| 56 | +} |
0 commit comments