protected override void HandleSetterAccessor(IInvocation invocation, PropertyData propertyData) { IPropertyDataInterceptor propertyInterceptor = _contentDataInterceptorHandler.GetPropertyInterceptor(propertyData.GetType()); if (propertyInterceptor != null) { Type parameterType = invocation.Method.GetParameters()[0].ParameterType; propertyInterceptor.SetValue(propertyData, parameterType, invocation.Arguments[0]); } else { propertyData.Value = invocation.Arguments[0]; } }
protected override void HandleGetterAccessor(IInvocation invocation, PropertyData propertyData) { IPropertyDataInterceptor propertyInterceptor = _contentDataInterceptorHandler.GetPropertyInterceptor(propertyData.GetType()); if (propertyInterceptor != null) { invocation.ReturnValue = propertyInterceptor.GetValue(propertyData, invocation.Method.ReturnType); } else if ((propertyData.Value == null) && invocation.Method.ReturnType.IsValueType) { invocation.ReturnValue = Activator.CreateInstance(invocation.Method.ReturnType); } else { invocation.ReturnValue = propertyData.Value; } }